Skip to content

Commit 77187bf

Browse files
committed
Fixed memory leak with cv method
1 parent 05a05c3 commit 77187bf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

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

37
- Added ARM shared library for Linux

lib/lightgbm/dataset.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ 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-
if used_indices
187-
@handle = handle.read_pointer
188-
else
189-
@handle = ::FFI::AutoPointer.new(handle.read_pointer, FFI.method(:LGBM_DatasetFree))
190-
end
186+
@handle = ::FFI::AutoPointer.new(handle.read_pointer, FFI.method(:LGBM_DatasetFree))
191187

192188
self.label = @label if @label
193189
self.weight = @weight if @weight

0 commit comments

Comments
 (0)