avoid unregistering widget model twice

widgets are registered when the comm is created;
closing unregisters them. Calling `close` a second time
should be a no-op.
This commit is contained in:
MinRK 2014-07-31 12:22:47 -07:00
parent 6d292040b4
commit 09c1354ea7

View File

@ -164,8 +164,8 @@ 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:
Widget.widgets.pop(self.model_id, None)
self._comm.close()
self._comm = None