Skip to content

Commit 05f31f9

Browse files
jamesobutlerjcfr
authored andcommitted
Prevent crashes during and after cleanup (cont'd)
This is a follow-up to HEAD~3 ("Prevent crashes during and after cleanup") (cherry picked from commit commontk/PythonQt@8aa183b)
1 parent 94037ee commit 05f31f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PythonQtObjectPtr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ PythonQtSafeObjectPtr::~PythonQtSafeObjectPtr()
172172
{
173173
if (_object) {
174174
PYTHONQT_GIL_SCOPE
175-
Py_DECREF(_object);
175+
if (_object && Py_IsInitialized()) Py_DECREF(_object);
176176
}
177177
}
178178

0 commit comments

Comments
 (0)