mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix thread stopping in ftrack login
This commit is contained in:
parent
689c483631
commit
bb77c72b98
2 changed files with 7 additions and 0 deletions
|
|
@ -238,6 +238,8 @@ class CredentialsDialog(QtWidgets.QDialog):
|
|||
|
||||
# If there is an existing server thread running we need to stop it.
|
||||
if self._login_server_thread:
|
||||
if self._login_server_thread.isAlive():
|
||||
self._login_server_thread.stop()
|
||||
self._login_server_thread.join()
|
||||
self._login_server_thread = None
|
||||
|
||||
|
|
|
|||
|
|
@ -61,12 +61,17 @@ class LoginServerThread(threading.Thread):
|
|||
def __init__(self, url, callback):
|
||||
self.url = url
|
||||
self.callback = callback
|
||||
self._server = None
|
||||
super(LoginServerThread, self).__init__()
|
||||
|
||||
def _handle_login(self, api_user, api_key):
|
||||
'''Login to server with *api_user* and *api_key*.'''
|
||||
self.callback(api_user, api_key)
|
||||
|
||||
def stop(self):
|
||||
if self._server:
|
||||
self._server.server_close()
|
||||
|
||||
def run(self):
|
||||
'''Listen for events.'''
|
||||
self._server = HTTPServer(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue