cap memory usage

This commit is contained in:
Akash Mozumdar 2019-04-26 20:55:07 -04:00
parent 2f7365acbd
commit 49e915c3b6

View File

@ -55,6 +55,8 @@ void TextThread::Push(BYTE* data, int length)
void TextThread::Flush()
{
if (storage->size() > 10'000'000) storage->erase(0, 8'000'000); // https://github.com/Artikash/Textractor/issues/127#issuecomment-486882983
std::vector<std::wstring> sentences;
queuedSentences->swap(sentences);
for (auto& sentence : sentences)