diff --git a/src/common/kiwix/indexer.cpp b/src/common/kiwix/indexer.cpp index 1779923a1..d85f119c7 100644 --- a/src/common/kiwix/indexer.cpp +++ b/src/common/kiwix/indexer.cpp @@ -33,7 +33,7 @@ namespace kiwix { } return numWords; } - + /* Constructor */ Indexer::Indexer() : keywordsBoostFactor(3), @@ -225,7 +225,7 @@ namespace kiwix { } /* Make a hard-disk flush every 10.000 articles */ - if (indexedArticleCount % 5000 == 0) { + if (indexedArticleCount % 500 == 0) { self->flush(); } diff --git a/src/common/stringTools.cpp b/src/common/stringTools.cpp index 0df74453a..9b22e4bf2 100644 --- a/src/common/stringTools.cpp +++ b/src/common/stringTools.cpp @@ -71,6 +71,7 @@ std::string kiwix::removeAccents(const std::string &text) { Transliterator *removeAccentsTrans = Transliterator::createInstance("Lower; NFD; [:M:] remove; NFC", UTRANS_FORWARD, status); UnicodeString ustring = UnicodeString(text.c_str()); removeAccentsTrans->transliterate(ustring); + delete removeAccentsTrans; std::string unaccentedText; ustring.toUTF8String(unaccentedText); return unaccentedText;