mirror of
https://github.com/reactos/reactos.git
synced 2026-05-30 23:33:24 +08:00
[BROWSEUI] CAutoComplete::OnAutoCompStart(): Wait on the thread only when there is a handle.
Avoids spamming (ntoskrnl\ob\obwait.c:441) Failed to reference the handle with status 0xc0000008 CAutoComplete::FinishCompletion(): Remove two useless 'if (m_pThread || !m_hThread)' tests: No need to check these after each code instruction...
This commit is contained in:
@@ -2092,13 +2092,16 @@ LRESULT CAutoComplete::OnAutoCompStart(UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||
delete pOld;
|
||||
|
||||
BOOL bDoStart = FALSE;
|
||||
DWORD dwWait = WaitForSingleObject(m_hThread, 0);
|
||||
if (dwWait != WAIT_TIMEOUT)
|
||||
if (m_hThread)
|
||||
{
|
||||
CloseHandle(m_hThread);
|
||||
bDoStart = TRUE;
|
||||
if (WaitForSingleObject(m_hThread, 0) != WAIT_TIMEOUT)
|
||||
{
|
||||
CloseHandle(m_hThread);
|
||||
m_hThread = NULL;
|
||||
bDoStart = TRUE;
|
||||
}
|
||||
}
|
||||
else if (!m_hThread)
|
||||
else
|
||||
{
|
||||
bDoStart = TRUE;
|
||||
}
|
||||
@@ -2131,15 +2134,9 @@ VOID CAutoComplete::FinishCompletion(PAC_THREAD pThread)
|
||||
if (!CanAutoSuggest() && !CanAutoAppend())
|
||||
return;
|
||||
|
||||
if (m_pThread || !m_hThread)
|
||||
return;
|
||||
|
||||
// set inner list
|
||||
m_innerList = pThread->m_innerList;
|
||||
|
||||
if (m_pThread || !m_hThread)
|
||||
return;
|
||||
|
||||
// set the items of the virtual listview
|
||||
m_outerList = pThread->m_outerList; // FIXME: We need more speed!
|
||||
m_hwndList.SendMessageW(LVM_SETITEMCOUNT, m_outerList.GetSize(), 0);
|
||||
|
||||
Reference in New Issue
Block a user