mirror of https://github.com/kiwix/libkiwix.git
Fix memory link.
If a `searcher` is already created we must delete it. If we set the pointer to NULL before, we will never delete it.
This commit is contained in:
parent
c56e1f0446
commit
4a51dd9e00
|
@ -486,7 +486,6 @@ JNIEXPORT jboolean JNICALL Java_org_kiwix_kiwixlib_JNIKiwix_loadFulltextIndex(
|
||||||
std::string cPath = jni2c(path, env);
|
std::string cPath = jni2c(path, env);
|
||||||
|
|
||||||
pthread_mutex_lock(&searcherLock);
|
pthread_mutex_lock(&searcherLock);
|
||||||
searcher = NULL;
|
|
||||||
try {
|
try {
|
||||||
if (searcher != NULL) {
|
if (searcher != NULL) {
|
||||||
delete searcher;
|
delete searcher;
|
||||||
|
|
Loading…
Reference in New Issue