Skip to content

Commit 57f5235

Browse files
committed
Revert "Fixed memory leak with cv method"
This reverts commit 77187bf.
1 parent 77187bf commit 57f5235

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
## 0.4.4 (unreleased)
2-
3-
- Fixed memory leak with `cv` method
4-
51
## 0.4.3 (2025-06-26)
62

73
- Added ARM shared library for Linux

lib/lightgbm/dataset.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ def construct
183183

184184
safe_call FFI.LGBM_DatasetCreateFromMat(c_data, FFI::C_API_DTYPE_FLOAT64, nrow, ncol, 1, parameters, reference, handle)
185185
end
186-
@handle = ::FFI::AutoPointer.new(handle.read_pointer, FFI.method(:LGBM_DatasetFree))
186+
if used_indices
187+
@handle = handle.read_pointer
188+
else
189+
@handle = ::FFI::AutoPointer.new(handle.read_pointer, FFI.method(:LGBM_DatasetFree))
190+
end
187191

188192
self.label = @label if @label
189193
self.weight = @weight if @weight

0 commit comments

Comments
 (0)