You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 70f89c2
Browse filesBrowse the repository at this point in the historyBrowse files
Fix leaked host objects from moving out of unique_ptr::release()
Several places called release() on a std::unique_ptr and then moved
from the raw pointer it returned, e.g. std::move(*ptr.release()) or
ptr.release()[0]. The device memory was moved out and freed normally,
but nothing deleted the small host-side object (rmm::device_buffer,
cuda::device_buffer, or cudf::column), so each call leaked it.
Move from *ptr instead so the unique_ptr keeps ownership and deletes
the moved-from object. This fixes the sites listed in NVIDIA#24926 plus the
same pattern in groupby argmin/argmax, the IO column_buffer, the JNI
list-overlap code, and the benchmark data generators.
Also add a note about this pattern to cpp/REVIEW_GUIDELINES.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: cpp/REVIEW_GUIDELINES.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@
42
42
- CUDA stream/event leaks or improper cleanup
43
43
- Missing RAII or proper cleanup, including in exception paths
44
44
- Raw owning pointers instead of `std::unique_ptr`, `std::shared_ptr`, `std::reference_wrapper`
45
+
- Moving from the raw pointer returned by `std::unique_ptr::release()` (e.g. `std::move(*ptr.release())`, `ptr.release()[0]`, `auto p = contents.data.release();`) leaks the host object; use `std::move(*ptr)` instead. (`table::release()` and `device_uvector::release()` return owning values and are fine.)
45
46
46
47
### API Breaking Changes
47
48
- C++ API changes without proper deprecation warnings
0 commit comments