File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -254,16 +254,13 @@ inline void finalize_interpreter() {
254
254
if (builtins.contains (id) && isinstance<capsule>(builtins[id])) {
255
255
internals_ptr_ptr = capsule (builtins[id]);
256
256
}
257
-
258
- Py_Finalize ();
259
-
260
257
// Local internals contains data managed by the current interpreter, so we must clear them to
261
258
// avoid undefined behaviors when initializing another interpreter
262
- // Must be cleared only after Py_Finalize() so atexit and other hooks can still use
263
- // registered_types
264
259
detail::get_local_internals ().registered_types_cpp .clear ();
265
260
detail::get_local_internals ().registered_exception_translators .clear ();
266
261
262
+ Py_Finalize ();
263
+
267
264
if (internals_ptr_ptr) {
268
265
delete *internals_ptr_ptr;
269
266
*internals_ptr_ptr = nullptr ;
You can’t perform that action at this time.
0 commit comments