Event loop implementation problem (Sys::Virt object not DESTROY anymore)
Hello,
I started to write an event loop contract to use the AnyEvent library. It works perfectly well, but one issue remains.
If I register an event, for example a simple domain lifecycle event type, as soon as the event is fired once (or more), my Sys::Virt object is never release because it seems his refcount doesn't go to zero, even after the event deregister and the Virt object isn't reference anywhere in my application.
If I register the event, but clean my connection before any event happens, no problem, the connection object is "DESTROY". So I checked into the XS callback function _domain_event_lifecycle_callback
:
I've seen the connection object reference counter is incremented (line 336 for the lifecycle one), but it's not decrease.
I've commented the line 336 (SvREFCNT_inc(*self)
) and then no problem, my connection object is release event if the event has been fired one or more times.
I suppose this SvREFCNT_inc
has a reason to be, but maybe be it can be decrement after the call_sv(*cb, G_DISCARD)
?
This is coded the same way in any event type callback, so the problem also appears with thoses events (tested with graphics events).
If it can help, I can provide my event contract impl.
I hope my description of the problem is clear enough ! Thanks Anthony.