Commit daec24a9 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

winmm: Destroy timer after calling callback.

parent b0750422
...@@ -107,7 +107,7 @@ static CONDITION_VARIABLE TIME_cv; ...@@ -107,7 +107,7 @@ static CONDITION_VARIABLE TIME_cv;
*/ */
static int TIME_MMSysTimeCallback(void) static int TIME_MMSysTimeCallback(void)
{ {
WINE_TIMERENTRY *timer, copy; WINE_TIMERENTRY *timer;
int i, delta_time; int i, delta_time;
/* since timeSetEvent() and timeKillEvent() can be called /* since timeSetEvent() and timeKillEvent() can be called
...@@ -139,15 +139,7 @@ static int TIME_MMSysTimeCallback(void) ...@@ -139,15 +139,7 @@ static int TIME_MMSysTimeCallback(void)
if (delta_time > 0) break; if (delta_time > 0) break;
if (timer->wFlags & TIME_PERIODIC) if (timer->wFlags & TIME_PERIODIC)
{
timer->dwTriggerTime += timer->wDelay; timer->dwTriggerTime += timer->wDelay;
}
else
{
copy = *timer;
timer->wTimerID = 0;
timer = ©
}
switch(timer->wFlags & (TIME_CALLBACK_EVENT_SET|TIME_CALLBACK_EVENT_PULSE)) switch(timer->wFlags & (TIME_CALLBACK_EVENT_SET|TIME_CALLBACK_EVENT_PULSE))
{ {
...@@ -171,9 +163,12 @@ static int TIME_MMSysTimeCallback(void) ...@@ -171,9 +163,12 @@ static int TIME_MMSysTimeCallback(void)
EnterCriticalSection(&WINMM_cs); EnterCriticalSection(&WINMM_cs);
if (flags & TIME_KILL_SYNCHRONOUS) LeaveCriticalSection(&TIME_cbcrst); if (flags & TIME_KILL_SYNCHRONOUS) LeaveCriticalSection(&TIME_cbcrst);
if (id != timer->wTimerID) timer = NULL;
} }
break; break;
} }
if (timer && !(timer->wFlags & TIME_PERIODIC))
timer->wTimerID = 0;
} }
return delta_time; return delta_time;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment