Closed dbrignoli closed 2 years ago
using capture
from sugar
in proc emit[T]()
like so:
capture subscriber_copy:
callSoon(proc (udata: pointer) = subscriber_copy.cb(bus, event, subscriber_copy, payload))
makes the test code from my previous comment output the expected text.
Hi, with which GC & nim version are you hitting this? EDIT: Just saw the version 1.6.4
Thanks for reporting! I have opened an PR integrating your fix, #271
Great, thank you @Menduist! I also tried to capture subscriber directly but found it didn't work. It's probably caused by an issue with the for loop macro implementation.
Expected output:
Actual output: