From 4a51dd9e009f8c2e41bf6bffd7bdbb74c349d422 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 4 Jul 2017 16:57:22 +0200 Subject: [PATCH] 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. --- src/android/kiwix.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/android/kiwix.cpp b/src/android/kiwix.cpp index fa8daafb7..2de373164 100644 --- a/src/android/kiwix.cpp +++ b/src/android/kiwix.cpp @@ -486,7 +486,6 @@ JNIEXPORT jboolean JNICALL Java_org_kiwix_kiwixlib_JNIKiwix_loadFulltextIndex( std::string cPath = jni2c(path, env); pthread_mutex_lock(&searcherLock); - searcher = NULL; try { if (searcher != NULL) { delete searcher;