mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 08:25:48 +00:00
[RTL]
- In Wait_thread_proc, prioritize the cancel event over the wait object. This avoids executing the callback again after RtlDeregisterWait has been called. Fixes ThemeStartCallback being called twice, causing a double free. CORE-13074 #resolve svn path=/trunk/; revision=74318
This commit is contained in:
parent
6de65ddcea
commit
21cb633c9e
1 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@ Wait_thread_proc(LPVOID Arg)
|
||||||
PRTLP_WAIT Wait = (PRTLP_WAIT) Arg;
|
PRTLP_WAIT Wait = (PRTLP_WAIT) Arg;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
BOOLEAN alertable = (Wait->Flags & WT_EXECUTEINIOTHREAD) != 0;
|
BOOLEAN alertable = (Wait->Flags & WT_EXECUTEINIOTHREAD) != 0;
|
||||||
HANDLE handles[2] = { Wait->Object, Wait->CancelEvent };
|
HANDLE handles[2] = { Wait->CancelEvent, Wait->Object };
|
||||||
LARGE_INTEGER timeout;
|
LARGE_INTEGER timeout;
|
||||||
HANDLE completion_event;
|
HANDLE completion_event;
|
||||||
|
|
||||||
|
@ -59,11 +59,11 @@ Wait_thread_proc(LPVOID Arg)
|
||||||
alertable,
|
alertable,
|
||||||
get_nt_timeout( &timeout, Wait->Milliseconds ) );
|
get_nt_timeout( &timeout, Wait->Milliseconds ) );
|
||||||
|
|
||||||
if (Status == STATUS_WAIT_0 || Status == STATUS_TIMEOUT)
|
if (Status == STATUS_WAIT_1 || Status == STATUS_TIMEOUT)
|
||||||
{
|
{
|
||||||
BOOLEAN TimerOrWaitFired;
|
BOOLEAN TimerOrWaitFired;
|
||||||
|
|
||||||
if (Status == STATUS_WAIT_0)
|
if (Status == STATUS_WAIT_1)
|
||||||
{
|
{
|
||||||
// TRACE( "object %p signaled, calling callback %p with context %p\n",
|
// TRACE( "object %p signaled, calling callback %p with context %p\n",
|
||||||
// Wait->Object, Wait->Callback,
|
// Wait->Object, Wait->Callback,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue