diff --git a/IPython/kernel/comm/comm.py b/IPython/kernel/comm/comm.py index d9c37af..fd4e1fb 100644 --- a/IPython/kernel/comm/comm.py +++ b/IPython/kernel/comm/comm.py @@ -70,6 +70,7 @@ class Comm(LoggingConfigurable): def __del__(self): """trigger close on gc""" self.close() + get_ipython().comm_manager.unregister_comm(self) # publishing messages diff --git a/IPython/kernel/comm/manager.py b/IPython/kernel/comm/manager.py index fdc7ba6..a4c5e5f 100644 --- a/IPython/kernel/comm/manager.py +++ b/IPython/kernel/comm/manager.py @@ -76,7 +76,6 @@ class CommManager(LoggingConfigurable): """Unregister a comm, and close its counterpart""" # unlike get_comm, this should raise a KeyError comm = self.comms.pop(comm_id) - comm.close() def get_comm(self, comm_id): """Get a comm with a particular id