Don't start the check_for_requests timer until after connected to Tor, and remove OnionShareGui.tor_con and TorConnectionDialog.t as class variables, making them local variables instead

This commit is contained in:
Micah Lee 2018-01-13 22:42:27 -08:00
parent ebbe490a65
commit 8f585db127
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 24 additions and 25 deletions

View file

@ -57,14 +57,14 @@ class TorConnectionDialog(QtWidgets.QProgressDialog):
def start(self):
common.log('TorConnectionDialog', 'start')
self.t = TorConnectionThread(self, self.settings, self.onion)
self.t.tor_status_update.connect(self._tor_status_update)
self.t.connected_to_tor.connect(self._connected_to_tor)
self.t.canceled_connecting_to_tor.connect(self._canceled_connecting_to_tor)
self.t.error_connecting_to_tor.connect(self._error_connecting_to_tor)
self.t.start()
t = TorConnectionThread(self, self.settings, self.onion)
t.tor_status_update.connect(self._tor_status_update)
t.connected_to_tor.connect(self._connected_to_tor)
t.canceled_connecting_to_tor.connect(self._canceled_connecting_to_tor)
t.error_connecting_to_tor.connect(self._error_connecting_to_tor)
t.start()
# The main thread needs to remain active, and checkign for Qt events,
# The main thread needs to remain active, and checking for Qt events,
# until the thread is finished. Otherwise it won't be able to handle
# accepting signals.
self.active = True