Show More
@@ -426,18 +426,16 b' class Widget(LoggingConfigurable):' | |||
|
426 | 426 | if not hasattr(self, '_comm') or self._comm is None: |
|
427 | 427 | self._comm = Comm(target_name=self.target_name) |
|
428 | 428 | self._comm.on_msg(self._handle_msg) |
|
429 |
self._comm.on_close(self._ |
|
|
430 | ||
|
431 | ||
|
432 | def _handle_close(self): | |
|
433 | """Called when the comm is closed by the front-end.""" | |
|
434 | self._close_communication() | |
|
429 | self._comm.on_close(self._close_communication) | |
|
435 | 430 | |
|
436 | 431 | |
|
437 | 432 | def _close_communication(self): |
|
438 | 433 | """Closes a communication with the front-end.""" |
|
439 | 434 | if hasattr(self, '_comm') and self._comm is not None: |
|
435 | try: | |
|
440 | 436 | self._comm.close() |
|
437 | finally: | |
|
438 | self._comm = None | |
|
441 | 439 | |
|
442 | 440 | |
|
443 | 441 | def _send(self, msg): |
General Comments 0
You need to be logged in to leave comments.
Login now