Skip to content

Commit

Permalink
[bugfix](memoryleak) close expr after it is pushdown to storage layer (
Browse files Browse the repository at this point in the history
…#18849)

Co-authored-by: yiguolei <yiguolei@gmail.com>
  • Loading branch information
2 people authored and morningman committed Apr 20, 2023
1 parent 4a70ea4 commit 81e5c6e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions be/src/vec/exec/scan/vscan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,16 @@ Status VScanNode::_normalize_predicate(VExpr* conjunct_expr_root, VExpr** output
*output_expr = conjunct_expr_root;
return Status::OK();
} else {
if (left_child == nullptr) {
conjunct_expr_root->children()[0]->close(
_state, *_vconjunct_ctx_ptr,
(*_vconjunct_ctx_ptr)->get_function_state_scope());
}
if (right_child == nullptr) {
conjunct_expr_root->children()[1]->close(
_state, *_vconjunct_ctx_ptr,
(*_vconjunct_ctx_ptr)->get_function_state_scope());
}
// here only close the and expr self, do not close the child
conjunct_expr_root->set_children({});
conjunct_expr_root->close(_state, *_vconjunct_ctx_ptr,
Expand Down

0 comments on commit 81e5c6e

Please sign in to comment.