quartz: Avoid accessing the advise_sink structure after it is queued.

It could already have been removed and freed.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-10-21 12:41:12 -05:00 committed by Alexandre Julliard
parent bf5b35f19b
commit e22e34ecf4
1 changed files with 1 additions and 1 deletions

View File

@ -206,6 +206,7 @@ static HRESULT add_sink(struct system_clock *clock, DWORD_PTR handle,
sink->due_time = due_time;
sink->period = period;
sink->cookie = InterlockedIncrement(&cookie_counter);
*cookie = sink->cookie;
EnterCriticalSection(&clock->cs);
list_add_tail(&clock->sinks, &sink->entry);
@ -217,7 +218,6 @@ static HRESULT add_sink(struct system_clock *clock, DWORD_PTR handle,
}
WakeConditionVariable(&clock->cv);
*cookie = sink->cookie;
return S_OK;
}