Skip to content

Commit

Permalink
LongRunningTask bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Jul 3, 2019
1 parent eb2d9a4 commit 22069f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/gui/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def __init__(self, wrapper):
def execute_script(self, command, args):
""" Execute the requested Faceswap Script """
logger.debug("Executing Faceswap: (command: '%s', args: %s)", command, args)
self.thread = None
self.command = command
kwargs = {"stdout": PIPE,
"stderr": PIPE,
Expand Down Expand Up @@ -190,7 +191,6 @@ def read_stdout(self):
logger.debug("Trigger update preview")
self.wrapper.tk_vars["updatepreview"].set(True)
print(output.strip())
self.thread = None
returncode = self.process.poll()
message = self.set_final_status(returncode)
self.wrapper.terminate(message)
Expand Down Expand Up @@ -354,6 +354,7 @@ def terminate(self):
else:
logger.debug("Termination Complete. Cleaning up")
_ = self.thread.get_result() # Terminate the LongRunningTask object
self.thread = None

def terminate_in_thread(self, command, process):
""" Terminate the subprocess """
Expand Down

0 comments on commit 22069f5

Please sign in to comment.