diff options
| author | Brian Potchik <brian@vector35.com> | 2026-03-09 12:53:24 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2026-03-09 12:53:24 -0400 |
| commit | 695a94cdd9bd5e886ee82da60ebc5ffca5972fcb (patch) | |
| tree | 5802bf13b071842b2fa44f6a9eb63c115973be1c /python | |
| parent | 770e9c0c75a943cd4d47ba3cb3be936d09a6c86f (diff) | |
Fix QueueGenerator GIL deadlock in search APIs.
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 13 |
1 files changed, 8 insertions, 5 deletions
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( |
