forked from Public-Mirror/Textractor
actual performance improvement
This commit is contained in:
parent
a36ba41eb4
commit
d1007097ad
@ -35,15 +35,17 @@ void TextThread::Flush()
|
|||||||
sentence = std::wstring(converted, MultiByteToWideChar(status & USING_UTF8 ? CP_UTF8 : 932, 0, buffer.data(), buffer.size(), converted, buffer.size()));
|
sentence = std::wstring(converted, MultiByteToWideChar(status & USING_UTF8 ? CP_UTF8 : 932, 0, buffer.data(), buffer.size(), converted, buffer.size()));
|
||||||
delete[] converted;
|
delete[] converted;
|
||||||
}
|
}
|
||||||
|
ttMutex.unlock();
|
||||||
AddSentence(sentence);
|
AddSentence(sentence);
|
||||||
|
ttMutex.lock();
|
||||||
memset(buffer.data(), 0, buffer.size());
|
memset(buffer.data(), 0, buffer.size());
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextThread::AddSentence(std::wstring sentence)
|
void TextThread::AddSentence(std::wstring sentence)
|
||||||
{
|
{
|
||||||
LOCK ttLock(ttMutex);
|
|
||||||
if (Output) sentence = Output(this, sentence);
|
if (Output) sentence = Output(this, sentence);
|
||||||
|
LOCK ttLock(ttMutex);
|
||||||
storage.append(sentence);
|
storage.append(sentence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user