ddbus icon indicating copy to clipboard operation
ddbus copied to clipboard

Unregister signals / router handlers

Open raphj opened this issue 4 years ago • 2 comments

I need to receive signals from a dbus object that is short lived. I'd like to be able to unregister patterns from routers to avoid memory leaks. At a first glance, it seems that this is not yet possible, unless I missed something.

Is a MessageRouter.unsetHandler or a unregisterRouter method planned?

I can take a shot for a PR if desired. I can try to do something for #57 too.

raphj avatar Aug 30 '21 21:08 raphj

doesn't seem like there is a method for it, you could remove it from the callTable object on your router object though and let the GC take care of it whenever it seems fit.

WebFreak001 avatar Aug 31 '21 12:08 WebFreak001

Indeed, this is what should be done and what I can already do. This should probably be provided by ddbus out of the box however

raphj avatar Aug 31 '21 12:08 raphj