Skip to content

Commit c8d0d54

Browse files
committed
Move Stub::DestroyPythonObjects call into Stub::DestroyInstance
1 parent 59cbe6d commit c8d0d54

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/pb_stub.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ Stub::GetOrCreateInstance()
10881088
void
10891089
Stub::DestroyInstance()
10901090
{
1091+
stub_instance->DestroyPythonObjects();
10911092
stub_instance.reset();
10921093
}
10931094

@@ -2197,7 +2198,6 @@ main(int argc, char** argv)
21972198
non_graceful_exit = true;
21982199

21992200
// Destroy stub and exit.
2200-
stub->DestroyPythonObjects();
22012201
logger.reset();
22022202
Stub::DestroyInstance();
22032203
exit(1);
@@ -2231,7 +2231,6 @@ main(int argc, char** argv)
22312231
// objects. If the scoped_interpreter is destroyed before the stub object,
22322232
// this process will no longer hold the GIL lock and destruction of the stub
22332233
// will result in segfault.
2234-
stub->DestroyPythonObjects();
22352234
logger.reset();
22362235
Stub::DestroyInstance();
22372236

0 commit comments

Comments
 (0)