From 5c46f268802217b774df23d4dcf07a6f7b0ebc20 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 30 Nov 2016 02:08:34 +0100 Subject: [PATCH] fix upcoming/asyncdispatch properly --- lib/upcoming/asyncdispatch.nim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/upcoming/asyncdispatch.nim b/lib/upcoming/asyncdispatch.nim index 6e14a9fe75..0b5ff89bab 100644 --- a/lib/upcoming/asyncdispatch.nim +++ b/lib/upcoming/asyncdispatch.nim @@ -1070,9 +1070,7 @@ when defined(windows) or defined(nimdoc): if cb(fd): # we need this check to avoid exception, if `unregister(event)` was # called in callback. - if ev.hWaiter != 0: - GC_ref(pcd.ovl) - pcd.ovl.data.cell = system.protect(rawEnv(pcd.ovl.data.cb)) + if ev.hWaiter != 0: unregister(ev) deallocShared(cast[pointer](pcd)) else: GC_ref(pcd.ovl)