Skip to content

Commit b3f69e3

Browse files
committed
Use the default destructor for PyCapsule
1 parent 196c68b commit b3f69e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: python/PyDLExt.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static std::vector<PyTensorBundle> kPyCapsulesPool;
2828

2929
inline PyCapsule enpycapsulate(DLManagedTensorPtr tensor, bool autodestruct = true)
3030
{
31-
auto capsule = PyCapsule(tensor, kDLTensorCapsuleName, nullptr);
31+
auto capsule = PyCapsule(tensor, kDLTensorCapsuleName); // default destructor is nullptr
3232
if (autodestruct)
3333
PyCapsule_SetDestructor(
3434
capsule.ptr(),

0 commit comments

Comments
 (0)