fix: don't destruct module objects in atexit (#5688)

This commit is contained in:
b-pass
2025-05-25 18:56:26 -04:00
committed by GitHub
parent 1dd85ef42a
commit 03b4a9e56f
3 changed files with 61 additions and 94 deletions

View File

@@ -78,8 +78,7 @@ TEST_SUBMODULE(modules, m) {
class DupeException {};
// Go ahead and leak, until we have a non-leaking py::module_ constructor
auto dm
= py::module_::create_extension_module("dummy", nullptr, new py::module_::module_def);
auto dm = py::module_::create_extension_module("dummy", nullptr, new PyModuleDef);
auto failures = py::list();
py::class_<Dupe1>(dm, "Dupe1");