mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-10 19:52:50 -03:00
Clean up watchdog thread when quitting, which avoids segfaults
This commit is contained in:
parent
76d88d0648
commit
aebc96142f
2 changed files with 11 additions and 3 deletions
|
@ -284,7 +284,5 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
e.accept()
|
||||
|
||||
def cleanup(self):
|
||||
for index in range(self.tabs.count()):
|
||||
tab = self.tabs.widget(index)
|
||||
tab.cleanup()
|
||||
self.tabs.cleanup()
|
||||
self.common.gui.onion.cleanup()
|
||||
|
|
|
@ -79,6 +79,16 @@ class TabWidget(QtWidgets.QTabWidget):
|
|||
self.observer.schedule(self.event_handler, self.common.gui.events_dir)
|
||||
self.observer.start()
|
||||
|
||||
def cleanup(self):
|
||||
# Stop the event thread
|
||||
self.observer.stop()
|
||||
self.observer.join()
|
||||
|
||||
# Clean up each tab
|
||||
for index in range(self.count()):
|
||||
tab = self.widget(index)
|
||||
tab.cleanup()
|
||||
|
||||
def move_new_tab_button(self):
|
||||
# Find the width of all tabs
|
||||
tabs_width = sum(
|
||||
|
|
Loading…
Reference in a new issue