From 3624ae97773fff54bb89999fd9441016fbe2769a Mon Sep 17 00:00:00 2001 From: collin-volk Date: Sat, 18 Mar 2023 17:20:45 -0500 Subject: [PATCH] Added check to ensure qthreads are finished before destroying them --- sutils/async.py | 3 +++ sutils/async_threads.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sutils/async.py b/sutils/async.py index 75f89eb7..0bd6e3fa 100644 --- a/sutils/async.py +++ b/sutils/async.py @@ -98,6 +98,9 @@ def finish(self, thread_id, ret_val): callback(ret_val) + while not self.threads[thread_id].isFinished(): + pass + del self.threads[thread_id] del self.callbacks[thread_id] diff --git a/sutils/async_threads.py b/sutils/async_threads.py index 509d4f96..8aac0c52 100644 --- a/sutils/async_threads.py +++ b/sutils/async_threads.py @@ -96,6 +96,9 @@ def finish(self, thread_id, ret_val): callback(ret_val) + while not self.threads[thread_id].isFinished(): + pass + del self.threads[thread_id] del self.callbacks[thread_id]