You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be simple enough to add, though I'm curious about the use-case. In general I'd think you'd want individual consumers cleaning up after themselves using the Unsubscribe methods instead of having some other process pull it out from under them; feel like a way to introduce hard-to-track bugs.
If there's a compelling use-case, though, I'm not opposed
Agreed. Consumers must unsubscribe themselves using the Unsubscribe methods.
I just thought that a cleaning method could be called as a last resource to prevent memory leaks. But I found out in the source code that the handler list keeps a weak reference and that should not be a problem. Also, the unit testing covers the garbage collector very well.
I also agree that it could introduce hard-to-track bugs. But it is fine if we just put it in the Hub class without an extension.
Can you add a method on the Hub class to clear the handler list?
The text was updated successfully, but these errors were encountered: