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 61e40f6 commit bebdbd2Copy full SHA for bebdbd2
include/pybind11/pybind11.h
@@ -466,7 +466,15 @@ class cpp_function : public function {
466
}
467
if (rec->def) {
468
std::free(const_cast<char *>(rec->def->ml_doc));
469
- //delete rec->def;
+ // Python 3.9.0 decref's these in the wrong order; rec->def
470
+ // If loaded on 3.9.0, let these leak (use Python 3.9.1 to fix)
471
+ // See https://github.com/python/cpython/pull/22670
472
+ #if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERISON == 9
473
+ if(Py_GetVersion()[4] != '0')
474
+ delete rec->def;
475
+ #else
476
477
+ #endif
478
479
delete rec;
480
rec = next;
0 commit comments