Skip to content

Commit

Permalink
fix: delete pointer more properly
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Dec 15, 2023
1 parent 2182a0c commit 34b5cd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fastmorph/fastmorphops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ py::array dilate_helper(
}
}


py::capsule capsule(output, [](void* ptr) {
delete[] ptr;
if (ptr) {
delete[] static_cast<LABEL*>(ptr);
}
});

uint64_t width = sizeof(LABEL);
Expand Down

0 comments on commit 34b5cd0

Please sign in to comment.