Add assert on callSoon(nil)

This commit is contained in:
cheatfate 2018-10-27 20:08:19 +03:00
parent 14dd1e9a8e
commit 163982bc6e
1 changed files with 1 additions and 0 deletions

View File

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