Skip to content

Commit

Permalink
Fix stuck that caused by internal await threadpool.is_all_thread_fini…
Browse files Browse the repository at this point in the history
…shed
  • Loading branch information
imjp94 committed Jun 11, 2023
1 parent 0e3069c commit cba2b38
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/gd-plug/plug.gd
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ func _plug_install():
if removed_plugins:
threadpool.disconnect("all_thread_finished", self, "request_quit")
if not threadpool.is_all_thread_finished():
threadpool.active = true
yield(threadpool, "all_thread_finished")
threadpool.active = false
logger.debug("All installation finished! Ready to uninstall removed plugins...")
threadpool.connect("all_thread_finished", self, "request_quit")
for plugin in removed_plugins:
Expand Down Expand Up @@ -214,7 +216,9 @@ func _plug_upgrade():
threadpool.enqueue_task(self, "install_plugin", gd_plug)
threadpool.disconnect("all_thread_finished", self, "request_quit")
if not threadpool.is_all_thread_finished():
threadpool.active = true
yield(threadpool, "all_thread_finished")
threadpool.active = false
logger.debug("All installation finished! Ready to uninstall removed plugins...")
threadpool.connect("all_thread_finished", self, "request_quit")
threadpool.enqueue_task(self, "directory_delete_recursively", gd_plug.plug_dir)
Expand All @@ -239,7 +243,9 @@ func _plug_status():
if has_checking_plugin:
logger.info("\n", true)
threadpool.disconnect("all_thread_finished", self, "request_quit")
threadpool.active = true
yield(threadpool, "all_thread_finished")
threadpool.active = false
threadpool.connect("all_thread_finished", self, "request_quit")
logger.debug("Finished checking plugins, ready to proceed")
if new_plugins:
Expand Down

0 comments on commit cba2b38

Please sign in to comment.