Skip to content

Commit e967f7c

Browse files
committed
Add DestroyPythonObjects call into destructor
1 parent cda7ced commit e967f7c

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/pb_stub.cc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,15 +1059,7 @@ Stub::~Stub()
10591059
}
10601060
#endif
10611061

1062-
// Ensure the interpreter is active before trying to clean up.
1063-
if (Py_IsInitialized()) {
1064-
py::gil_scoped_acquire acquire;
1065-
py::object async_event_loop_local(std::move(async_event_loop_));
1066-
py::object background_futures_local(std::move(background_futures_));
1067-
py::object model_instance_local(std::move(model_instance_));
1068-
py::object deserialize_bytes_local(std::move(deserialize_bytes_));
1069-
py::object serialize_bytes_local(std::move(serialize_bytes_));
1070-
}
1062+
DestroyPythonObjects();
10711063

10721064
stub_message_queue_.reset();
10731065
parent_message_queue_.reset();

0 commit comments

Comments
 (0)