win32/Ticker: Stop ticker on exit
authorBen Gamari <bgamari.foss@gmail.com>
Sat, 22 Apr 2017 13:33:31 +0000 (09:33 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 23 Apr 2017 15:05:48 +0000 (11:05 -0400)
While debugging an unrelated issue I noticed that we leak a
TimerQueueTimer on exit since we don't necessarily call stopTicker
before exitTicker. Fix this.

Test Plan: Validate on Windows

Reviewers: simonmar, austin, erikd

Reviewed By: simonmar

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3477

rts/win32/Ticker.c

index 7bc5ed5..27c9070 100644 (file)
@@ -73,6 +73,7 @@ stopTicker(void)
 void
 exitTicker (bool wait)
 {
+    stopTicker();
     if (timer_queue != NULL) {
         DeleteTimerQueueEx(timer_queue, wait ? INVALID_HANDLE_VALUE : NULL);
         timer_queue = NULL;