fix upcoming/asyncdispatch properly

This commit is contained in:
Araq
2016-11-30 02:08:34 +01:00
parent 3f7694d08a
commit 5c46f26880

View File

@@ -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)