diff --git a/ui/bin/opensnitch-ui b/ui/bin/opensnitch-ui index 336c5bf0..3725827a 100755 --- a/ui/bin/opensnitch-ui +++ b/ui/bin/opensnitch-ui @@ -243,3 +243,7 @@ Examples: on_exit() except Exception as e: print(e) + finally: + if service: + # finish gracefully, closing notifications channel. + service.close() diff --git a/ui/opensnitch/service.py b/ui/opensnitch/service.py index 0aee9116..3acf5dd9 100644 --- a/ui/opensnitch/service.py +++ b/ui/opensnitch/service.py @@ -743,6 +743,11 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject): elif kwargs['action'] == self.NODE_DELETE: self._delete_node(kwargs['peer']) + def OpenWindow(self): + self._stats_dialog.show() + + def close(self): + self._on_close() def PostAlert(self, alert, context): proto, addr = self._get_peer(context.peer()) @@ -935,6 +940,3 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject): context.cancel() return node_iter - - def OpenWindow(self): - self._stats_dialog.show()