]> git.sesse.net Git - vlc/commitdiff
Win32: wait for timer callbacks to complete when destroying timer
authorPierre Ynard <linkfanel@yahoo.fr>
Thu, 30 Jul 2009 09:16:15 +0000 (11:16 +0200)
committerPierre Ynard <linkfanel@yahoo.fr>
Thu, 30 Jul 2009 09:16:15 +0000 (11:16 +0200)
Or else a timer callback might still be running when the caller frees
its resources, which is bad

src/misc/w32thread.c

index a2ef9eca272ee5e561154152fa1983a733891c94..b3697334a3f6d7ec95577813360fbfd1ca80e757 100644 (file)
@@ -611,7 +611,7 @@ int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data)
 void vlc_timer_destroy (vlc_timer_t *id)
 {
     if (id->handle != INVALID_HANDLE_VALUE)
-        DeleteTimerQueueTimer (NULL, id->handle, NULL);
+        DeleteTimerQueueTimer (NULL, id->handle, INVALID_HANDLE_VALUE);
 }
 
 void vlc_timer_schedule (vlc_timer_t *id, bool absolute,