From 6aaa96569f7a6ad9dbf52b355cabce925e90b19d Mon Sep 17 00:00:00 2001 From: cheatfate Date: Wed, 12 Dec 2018 13:07:41 +0200 Subject: [PATCH] Fix removeReader/removeWriter can produce SIGSEGV. --- asyncdispatch2.nimble | 2 +- asyncdispatch2/asyncloop.nim | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/asyncdispatch2.nimble b/asyncdispatch2.nimble index a48cdd3..1d42df5 100644 --- a/asyncdispatch2.nimble +++ b/asyncdispatch2.nimble @@ -1,5 +1,5 @@ packageName = "asyncdispatch2" -version = "2.1.5" +version = "2.1.6" author = "Status Research & Development GmbH" description = "Asyncdispatch2" license = "Apache License 2.0 or MIT" diff --git a/asyncdispatch2/asyncloop.nim b/asyncdispatch2/asyncloop.nim index e88a010..b1d487b 100644 --- a/asyncdispatch2/asyncloop.nim +++ b/asyncdispatch2/asyncloop.nim @@ -234,7 +234,8 @@ template processCallbacks(loop: untyped) = # can be generated. if len(loop.callbacks) == 0: break let callable = loop.callbacks.popFirst() - callable.function(callable.udata) + if not isNil(callable.function): + callable.function(callable.udata) when defined(windows) or defined(nimdoc): import winlean, sets, hashes