forked from Public-Mirror/Textractor
fix out of memory error when history size too low
This commit is contained in:
parent
c3274b8275
commit
2333692448
@ -72,7 +72,10 @@ void TextThread::Push(BYTE* data, int length)
|
||||
|
||||
void TextThread::Flush()
|
||||
{
|
||||
if (storage->size() > maxHistorySize) storage->erase(0, maxHistorySize / 2); // https://github.com/Artikash/Textractor/issues/127#issuecomment-486882983
|
||||
{
|
||||
auto storage = this->storage.Acquire();
|
||||
if (storage->size() > maxHistorySize) storage->erase(0, storage->size() - maxHistorySize); // https://github.com/Artikash/Textractor/issues/127#issuecomment-486882983
|
||||
}
|
||||
|
||||
std::deque<std::wstring> sentences;
|
||||
queuedSentences->swap(sentences);
|
||||
|
Loading…
x
Reference in New Issue
Block a user