We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 309c269 commit 498ace9Copy full SHA for 498ace9
clayer/pysertype.c
@@ -487,8 +487,15 @@ static void sertype_free (struct ddsi_sertype *tpcmn)
487
dds_free (this->typemap_ser_data);
488
dds_cdrstream_desc_fini (&this->cdrstream_desc, &cdrstream_allocator);
489
490
- // dds_free the python type if python isn't already shutting down (deadlock).
491
-#if PY_MINOR_VERSION > 6
+ // dds_free the python type if python isn't already shutting down (deadlock).#
+#if PY_MINOR_VERSION >= 13
492
+ if (!Py_IsFinalizing ())
493
+ {
494
+ PyGILState_STATE state = PyGILState_Ensure ();
495
+ Py_DECREF (this->my_py_type);
496
+ PyGILState_Release (state);
497
+ }
498
+#elif PY_MINOR_VERSION > 6
499
if (!_Py_IsFinalizing ())
500
{
501
PyGILState_STATE state = PyGILState_Ensure ();
0 commit comments