Skip to content

Commit 36f9242

Browse files
ui: fixed delay closing the GUI
When closing the GUI we were not stopping notifications channel in all cases, causing some issues (delays, log in/out problems, ...). Closes #1217 (cherry picked from commit cdf93c7)
1 parent 446cb1a commit 36f9242

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ui/bin/opensnitch-ui

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,7 @@ Examples:
243243
on_exit()
244244
except Exception as e:
245245
print(e)
246+
finally:
247+
if service:
248+
# finish gracefully, closing notifications channel.
249+
service.close()

ui/opensnitch/service.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,11 @@ def _on_node_actions(self, kwargs):
707707
elif kwargs['action'] == self.NODE_DELETE:
708708
self._delete_node(kwargs['peer'])
709709

710+
def OpenWindow(self):
711+
self._stats_dialog.show()
712+
713+
def close(self):
714+
self._on_close()
710715

711716
def PostAlert(self, alert, context):
712717
proto, addr = self._get_peer(context.peer())
@@ -899,6 +904,3 @@ def new_node_message():
899904
context.cancel()
900905

901906
return node_iter
902-
903-
def OpenWindow(self):
904-
self._stats_dialog.show()

0 commit comments

Comments
 (0)