From 49e915c3b6ec54760f4d3edddc0a2c78f968e699 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 26 Apr 2019 20:55:07 -0400 Subject: [PATCH] cap memory usage --- GUI/host/textthread.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GUI/host/textthread.cpp b/GUI/host/textthread.cpp index 7377542..b32223a 100644 --- a/GUI/host/textthread.cpp +++ b/GUI/host/textthread.cpp @@ -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 sentences; queuedSentences->swap(sentences); for (auto& sentence : sentences)