From 695a94cdd9bd5e886ee82da60ebc5ffca5972fcb Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Mon, 9 Mar 2026 12:53:24 -0400 Subject: Fix QueueGenerator GIL deadlock in search APIs. --- python/binaryview.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index 4b8fedbd..884745a6 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -9530,11 +9530,14 @@ to a the type "tagRECT" found in the typelibrary "winX64common" def __next__(self): while True: - if not self.results.empty(): - return self.results.get() - - if (not self.thread.is_alive()) and self.results.empty(): - raise StopIteration + try: + return self.results.get(timeout=0.1) + except queue.Empty: + if not self.thread.is_alive(): + try: + return self.results.get_nowait() + except queue.Empty: + raise StopIteration @overload def find_all_data( -- cgit v1.3.1