File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -445,7 +445,7 @@ PYBIND11_NOINLINE internals &get_internals() {
445
445
}
446
446
}
447
447
448
- if (internals_pp) {
448
+ if (internals_pp && *internals_pp ) {
449
449
// We loaded builtins through python's builtins, which means that our `error_already_set`
450
450
// and `builtin_exception` may be different local classes than the ones set up in the
451
451
// initial exception translator, below, so add another for our local exception classes.
@@ -457,7 +457,9 @@ PYBIND11_NOINLINE internals &get_internals() {
457
457
(*internals_pp)->registered_exception_translators .push_front (&translate_local_exception);
458
458
#endif
459
459
} else {
460
- internals_pp = new internals *();
460
+ if (!internals_pp) {
461
+ internals_pp = new internals *();
462
+ }
461
463
auto *&internals_ptr = *internals_pp;
462
464
internals_ptr = new internals ();
463
465
#if defined(WITH_THREAD)
You can’t perform that action at this time.
0 commit comments