mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-07 14:23:01 -04:00
Sleep between launching threads in onionshare-gui, preventing a cx_Freeze crash related to loading the same modules in multiple threads while they're locked
This commit is contained in:
parent
76937d5cb5
commit
373f24e64b
1 changed files with 10 additions and 8 deletions
|
@ -144,6 +144,13 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||||
# pick an available local port for the http service to listen on
|
# pick an available local port for the http service to listen on
|
||||||
self.app.choose_port()
|
self.app.choose_port()
|
||||||
|
|
||||||
|
# start onionshare http service in new thread
|
||||||
|
t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open, self.app.transparent_torification))
|
||||||
|
t.daemon = True
|
||||||
|
t.start()
|
||||||
|
# wait for modules in thread to load, preventing a thread-related cx_Freeze crash
|
||||||
|
time.sleep(0.2)
|
||||||
|
|
||||||
# start the onion service in a new thread
|
# start the onion service in a new thread
|
||||||
def start_onion_service(self):
|
def start_onion_service(self):
|
||||||
self.status_bar.showMessage(strings._('gui_starting_server1', True))
|
self.status_bar.showMessage(strings._('gui_starting_server1', True))
|
||||||
|
@ -155,14 +162,9 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||||
self.starting_server_error.emit(e.args[0])
|
self.starting_server_error.emit(e.args[0])
|
||||||
return
|
return
|
||||||
|
|
||||||
t1 = threading.Thread(target=start_onion_service, kwargs={'self': self})
|
t = threading.Thread(target=start_onion_service, kwargs={'self': self})
|
||||||
t1.daemon = True
|
t.daemon = True
|
||||||
t1.start()
|
t.start()
|
||||||
|
|
||||||
# start onionshare http service in new thread
|
|
||||||
t2 = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open, self.app.transparent_torification))
|
|
||||||
t2.daemon = True
|
|
||||||
t2.start()
|
|
||||||
|
|
||||||
def start_server_step2(self):
|
def start_server_step2(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue