mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 17:04:12 +08:00
bugfix
This commit is contained in:
parent
634bb04f48
commit
b1b4625a06
@ -17,6 +17,7 @@ TextThread::TextThread(ThreadParameter tp, unsigned int threadNumber, unsigned i
|
|||||||
storage(),
|
storage(),
|
||||||
sentenceBuffer(),
|
sentenceBuffer(),
|
||||||
status(0),
|
status(0),
|
||||||
|
flushTimer(0),
|
||||||
threadNumber(threadNumber),
|
threadNumber(threadNumber),
|
||||||
splitDelay(splitDelay),
|
splitDelay(splitDelay),
|
||||||
output(nullptr),
|
output(nullptr),
|
||||||
@ -28,6 +29,7 @@ TextThread::TextThread(ThreadParameter tp, unsigned int threadNumber, unsigned i
|
|||||||
TextThread::~TextThread()
|
TextThread::~TextThread()
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&ttCs);
|
EnterCriticalSection(&ttCs);
|
||||||
|
KillTimer(dummyWindow, flushTimer);
|
||||||
LeaveCriticalSection(&ttCs);
|
LeaveCriticalSection(&ttCs);
|
||||||
DeleteCriticalSection(&ttCs);
|
DeleteCriticalSection(&ttCs);
|
||||||
}
|
}
|
||||||
@ -75,7 +77,7 @@ void TextThread::AddText(const BYTE *con, int len)
|
|||||||
{
|
{
|
||||||
TT_LOCK;
|
TT_LOCK;
|
||||||
sentenceBuffer.insert(sentenceBuffer.end(), con, con + len);
|
sentenceBuffer.insert(sentenceBuffer.end(), con, con + len);
|
||||||
SetTimer(dummyWindow, (UINT_PTR)this, splitDelay,
|
flushTimer = SetTimer(dummyWindow, (UINT_PTR)this, splitDelay,
|
||||||
[](HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
|
[](HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
|
||||||
{
|
{
|
||||||
KillTimer(hWnd, idEvent);
|
KillTimer(hWnd, idEvent);
|
||||||
|
@ -57,6 +57,7 @@ private:
|
|||||||
unsigned int threadNumber;
|
unsigned int threadNumber;
|
||||||
unsigned int splitDelay;
|
unsigned int splitDelay;
|
||||||
DWORD status;
|
DWORD status;
|
||||||
|
unsigned int flushTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user