In the constructor of my custom composite (inherited from SWT Composite
), I register myself as an EventHandler to the Eclipse IEventBroker
.
To unsubscribe upon disposal, I had overridden the dispose
method where I unsubscribe myself.
But I now noticed that this unsubscription is not happening, indeed the dispose
method is never getting called.
What is the correct way to unsubscribe myself, or to avoid that a closed Composite/ViewPart leaves "leaking" event handlers behind?
I use Eclipse RCP 3.x (so no annotations/injection). In E4 I could use the automatic Event subscription or the @Predestroy method, if I understood it correctly.