Skip to content

Commit 54059d3

Browse files
authored
Merge pull request #10706 from ariesdevil/quantile
fix: manual drop state to prevent memory leak
2 parents 5dc4c8b + 27bd972 commit 54059d3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/query/functions/src/aggregates/aggregate_quantile_cont.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ where T: Number + AsPrimitive<f64>
230230
let state = place.get::<QuantileState>();
231231
state.merge_result(builder, self.levels.clone())
232232
}
233+
234+
fn need_manual_drop_state(&self) -> bool {
235+
true
236+
}
237+
238+
unsafe fn drop_state(&self, place: StateAddr) {
239+
let state = place.get::<QuantileState>();
240+
std::ptr::drop_in_place(state);
241+
}
233242
}
234243

235244
impl<T> AggregateQuantileContFunction<T>

0 commit comments

Comments
 (0)