diff --git a/src/indexer/kiwix-index.cpp b/src/indexer/kiwix-index.cpp index 70f32b4..ba10837 100644 --- a/src/indexer/kiwix-index.cpp +++ b/src/indexer/kiwix-index.cpp @@ -104,6 +104,7 @@ int main(int argc, char **argv) { /* Start the indexing */ if (indexer != NULL) { while (indexer->indexNextPercent(verboseFlag)) {}; + delete indexer; } else { cerr << "Unable instanciate the Kiwix indexer." << endl; exit(1); diff --git a/src/searcher/kiwix-search.cpp b/src/searcher/kiwix-search.cpp index df4b5e2..d4a10f2 100644 --- a/src/searcher/kiwix-search.cpp +++ b/src/searcher/kiwix-search.cpp @@ -32,12 +32,14 @@ void usage() { int main(int argc, char **argv) { /* Init the variables */ - char *indexPath = NULL; - char *search = NULL; + //const char *indexPath = "/home/itamar/.www.kiwix.org/kiwix/43k0i1j4.default/6d2e587b-d586-dc6a-dc6a-e4ef035a1495d15c.index"; + //const char *indexPath = "/home/itamar/testindex"; + const char *indexPath = NULL; + const char *search = NULL; bool verboseFlag = false; int option_index = 0; int c = 0; - supportedBackend backend = XAPIAN; + supportedBackend backend = CLUCENE; kiwix::Searcher *searcher = NULL; @@ -110,6 +112,8 @@ int main(int argc, char **argv) { while (searcher->getNextResult(url, title, score)) { cout << title << endl; } + delete searcher; + kiwix::CluceneSearcher::terminate(); } else { cerr << "Unable instanciate the Kiwix searcher." << endl; exit(1);