mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
Check if the interpreter still exists before trying to acquire the GIL
This commit is contained in:
@@ -6101,14 +6101,14 @@ void sip_api_instance_destroyed(sipSimpleWrapper *sw)
|
|||||||
*/
|
*/
|
||||||
static void sip_api_instance_destroyed_ex(sipSimpleWrapper **sipSelfp)
|
static void sip_api_instance_destroyed_ex(sipSimpleWrapper **sipSelfp)
|
||||||
{
|
{
|
||||||
SIP_BLOCK_THREADS
|
|
||||||
|
|
||||||
sipSimpleWrapper *sipSelf = *sipSelfp;
|
sipSimpleWrapper *sipSelf = *sipSelfp;
|
||||||
|
|
||||||
if (sipSelf != NULL && sipInterpreter != NULL)
|
if (sipSelf != NULL && sipInterpreter != NULL)
|
||||||
{
|
{
|
||||||
PyObject *xtype, *xvalue, *xtb;
|
PyObject *xtype, *xvalue, *xtb;
|
||||||
|
|
||||||
|
SIP_BLOCK_THREADS
|
||||||
|
|
||||||
/* We may be tidying up after an exception so preserve it. */
|
/* We may be tidying up after an exception so preserve it. */
|
||||||
PyErr_Fetch(&xtype, &xvalue, &xtb);
|
PyErr_Fetch(&xtype, &xvalue, &xtb);
|
||||||
callPyDtor(sipSelf);
|
callPyDtor(sipSelf);
|
||||||
@@ -6136,6 +6136,8 @@ static void sip_api_instance_destroyed_ex(sipSimpleWrapper **sipSelfp)
|
|||||||
{
|
{
|
||||||
removeFromParent((sipWrapper *)sipSelf);
|
removeFromParent((sipWrapper *)sipSelf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SIP_UNBLOCK_THREADS
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -6145,8 +6147,6 @@ static void sip_api_instance_destroyed_ex(sipSimpleWrapper **sipSelfp)
|
|||||||
* reimplemented virtuals.
|
* reimplemented virtuals.
|
||||||
*/
|
*/
|
||||||
*sipSelfp = NULL;
|
*sipSelfp = NULL;
|
||||||
|
|
||||||
SIP_UNBLOCK_THREADS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user