Commit 77f8681c authored by Remi Perenon's avatar Remi Perenon

Ensure unsubscription in the molecular viewer

parent d8733d71
......@@ -251,12 +251,17 @@ class MolecularViewerPlugin(ComponentPlugin):
self.SetFocusIgnoringChildren()
def close(self):
def close(self):
# Ensure unsubscription
self.__unsubscribe()
# Clear the viewer
self.clear_universe()
def __del__(self):
def __del__(self):
# Ensure unsubscription
self.__unsubscribe()
def __unsubscribe(self):
PUBLISHER.unsubscribe(self.msg_set_selection, "msg_set_selection")
PUBLISHER.unsubscribe(self.msg_switch_viewers_state, "msg_switch_viewers_state")
PUBLISHER.unsubscribe(self.msg_clear_selection,'msg_clear_selection')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment