vaadin / collaboration-engine

The simplest way to build real-time collaboration into web apps
https://vaadin.com/collaboration
Other
3 stars 1 forks source link

ComponentConnectionContext does not do clean up all listeners if closed through the registration #44

Closed Legioth closed 2 years ago

Legioth commented 3 years ago

If running remove() on the Registration returned by ComponentConnectionContext::setActivationHandler while there is some attached component, then all detach handlers will be removed but we won't be running deactivateConnection() which takes care of removing references to the ComponentConnectionContext instance from the global handler lists in BeaconHandler and ServiceDestroyDelegate. Unless I've read the code wrong, this means that we would end up leaking some memory.

heruan commented 3 years ago

Add a test to verify that not all the listeners are removed when deactivating the context; then, fix the bug.