Skip to content

Commit 2082a3c

Browse files
committed
fix: Hold GIL when deleting numpy array
1 parent 8e12347 commit 2082a3c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pb_tensor.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,14 @@ PbTensor::~PbTensor() noexcept(false)
503503
{
504504
pb_memory_.reset();
505505
DeleteDLPack();
506+
507+
#ifdef TRITON_PB_STUB
508+
{
509+
py::gil_scoped_acquire acquire;
510+
py::array numpy_array_local(std::move(numpy_array_));
511+
py::array numpy_array_serialized_local(std::move(numpy_array_serialized_));
512+
}
513+
#endif
506514
}
507515

508516
const std::string&

0 commit comments

Comments
 (0)