Fix crash when canceling while compressing files, and also prevent canceled share from starting when compressing finishes

This commit is contained in:
Micah Lee 2018-04-24 08:48:17 -07:00
parent 9b2b815525
commit bda82bc7a0
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 20 additions and 11 deletions

View file

@ -146,6 +146,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.share_mode.server_status.server_stopped.connect(self.update_server_status_indicator)
self.share_mode.start_server_finished.connect(self.update_server_status_indicator)
self.share_mode.stop_server_finished.connect(self.update_server_status_indicator)
self.share_mode.stop_server_finished.connect(self.stop_server_finished)
self.share_mode.start_server_finished.connect(self.clear_message)
self.share_mode.server_status.button_clicked.connect(self.clear_message)
self.share_mode.server_status.url_copied.connect(self.copy_url)
@ -255,6 +256,10 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.systemTray.setContextMenu(menu)
self.systemTray.show()
def stop_server_finished(self):
# When the server stopped, cleanup the ephemeral onion service
self.onion.cleanup(stop_tor=False)
def _tor_connection_canceled(self):
"""
If the user cancels before Tor finishes connecting, ask if they want to