diff --git a/asyncdispatch2/asyncloop.nim b/asyncdispatch2/asyncloop.nim index 7301355d..e88a0102 100644 --- a/asyncdispatch2/asyncloop.nim +++ b/asyncdispatch2/asyncloop.nim @@ -745,6 +745,7 @@ include asyncmacro2 proc callSoon(cbproc: CallbackFunc, data: pointer = nil) = ## Schedule `cbproc` to be called as soon as possible. ## The callback is called when control returns to the event loop. + assert cbproc != nil let acb = AsyncCallback(function: cbproc, udata: data) getGlobalDispatcher().callbacks.addLast(acb)