From 671c5c48df9eb0e41f65d7ffd31706fa168d9648 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Tue, 19 Dec 2023 15:55:47 +0100 Subject: [PATCH] Fix GIL for get_unused_name Fixes https://github.com/schrodinger/pymol-open-source/issues/320 --- layer4/Cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layer4/Cmd.cpp b/layer4/Cmd.cpp index e7c336f76..ce9852b0c 100644 --- a/layer4/Cmd.cpp +++ b/layer4/Cmd.cpp @@ -2319,9 +2319,9 @@ static PyObject *CmdGetUnusedName(PyObject * self, PyObject * args) } else { API_HANDLE_ERROR; } - if (ok && (ok = APIEnterNotModal(G))) { + if (ok && (ok = APIEnterBlockedNotModal(G))) { auto result = PConvToPyObject(ExecutiveGetUnusedName(G, prefix, alwaysnumber)); - APIExit(G); + APIExitBlocked(G); return result; } else { return APIResultOk(ok);