mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
del Widget.widgets[seld.model_id] in close rather than in __del__
This commit is contained in:
parent
2c648fe4d0
commit
ea52ef8704
@ -127,8 +127,6 @@ class Widget(LoggingConfigurable):
|
||||
def __del__(self):
|
||||
"""Object disposal"""
|
||||
self.close()
|
||||
del Widget.widgets[self.model_id]
|
||||
self._comm = None
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Properties
|
||||
@ -166,6 +164,7 @@ class Widget(LoggingConfigurable):
|
||||
Closes the underlying comm.
|
||||
When the comm is closed, all of the widget views are automatically
|
||||
removed from the front-end."""
|
||||
del Widget.widgets[self.model_id]
|
||||
if self._comm is not None:
|
||||
self._comm.close()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user