another experiment

This commit is contained in:
Adam D. Ruppe 2018-02-08 10:48:07 -05:00
parent 02180151ce
commit 8bc5559cf6
1 changed files with 4 additions and 2 deletions

View File

@ -2331,7 +2331,7 @@ struct EventLoopImpl {
int pulseFd = -1; int pulseFd = -1;
version(linux) ep.epoll_event[16] events = void; version(linux) ep.epoll_event[16] events = void;
} else version(Windows) { } else version(Windows) {
static Timer pulser; // this is static so the GC doesn't try to reap it; we want to manage it ourselves Timer pulser;
HANDLE[] handles; HANDLE[] handles;
} }
@ -2469,8 +2469,10 @@ struct EventLoopImpl {
} }
} else version(Windows) { } else version(Windows) {
if(pulser !is null) if(pulser !is null) {
pulser.destroy(); pulser.destroy();
pulser = null;
}
if (customEventH !is null) { if (customEventH !is null) {
CloseHandle(customEventH); CloseHandle(customEventH);
customEventH = null; customEventH = null;