Skip to content

Commit baca87f

Browse files
committed
Prevent crashes during and after cleanup
This is a follow-up to commontk@4c8d5c1.
1 parent e9da73c commit baca87f

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)