mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
Store reference to thread in ShellCommand
This commit is contained in:
parent
e220211140
commit
664fefe2e5
2 changed files with 6 additions and 4 deletions
|
@ -31,12 +31,13 @@ func run_async(command, crash_on_fail=true):
|
|||
shell_command.command = command
|
||||
shell_command.crash_on_fail = crash_on_fail
|
||||
|
||||
var _thread = Thread.new()
|
||||
_thread.start(self, "run_async_thread", shell_command)
|
||||
var t = Thread.new()
|
||||
shell_command.thread = t
|
||||
t.start(self, "run_async_thread", shell_command)
|
||||
|
||||
return shell_command
|
||||
|
||||
func run_async_thread(shell_command):
|
||||
func run_async_thread(shell_command):
|
||||
var debug = false
|
||||
|
||||
var command = shell_command.command
|
||||
|
@ -88,7 +89,7 @@ func run_async_thread(shell_command):
|
|||
|
||||
shell_command.output = result["output"]
|
||||
shell_command.exit_code = result["exit_code"]
|
||||
shell_command.emit_signal("done")
|
||||
shell_command.emit_signal("done")
|
||||
|
||||
func _shell_binary():
|
||||
if _os == "X11" or _os == "OSX":
|
||||
|
|
|
@ -7,3 +7,4 @@ var command
|
|||
var output
|
||||
var exit_code
|
||||
var crash_on_fail = true
|
||||
var thread
|
||||
|
|
Loading…
Reference in a new issue