Closed ix-dcourtois closed 7 years ago
Ok, sorry for the multiple commits, I should have tested a bit more before commiting. The last commit (172376f) should do the trick.
Basically I added a boolean member to SeExpr::ExprFuncNode::Data
which is initialized to false
by deafult (to keep the current behavior of SeExpr) When the node is destroyed, it checked if it has some data, and if so, will destroy it if that member is true.
This way users can flag their function's data to be automatically cleaned up, or left as it is (if they returned a pointer to a static/global or are managing their destruction themselves)
Makes sense -- thanks!
Here is a proposition to fix user data leaks when returning new data in a
ExprFuncSimple::evalConstant
call.