Skip to content

Commit d053a3d

Browse files
committed
chore: setting py obj to None may not destruct the object
1 parent 2082a3c commit d053a3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pb_stub.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,9 +1032,9 @@ Stub::~Stub()
10321032

10331033
{
10341034
py::gil_scoped_acquire acquire;
1035-
async_event_loop_ = py::none();
1036-
background_futures_ = py::none();
1037-
model_instance_ = py::none();
1035+
py::object async_event_loop_local(std::move(async_event_loop_));
1036+
py::object background_futures_local(std::move(background_futures_));
1037+
py::object model_instance_local(std::move(model_instance_));
10381038
}
10391039
stub_instance_.reset();
10401040
stub_message_queue_.reset();

0 commit comments

Comments
 (0)