Skip to content

Clear EQ_Constraints in Domain::clearAll() (fixes leak + stale non-empty domain after wipe) - #33

Open
nmorabowen wants to merge 1 commit into
jaabell:ladruñofrom
nmorabowen:up/04-domain-clearall-eq-leak
Open

Clear EQ_Constraints in Domain::clearAll() (fixes leak + stale non-empty domain after wipe)#33
nmorabowen wants to merge 1 commit into
jaabell:ladruñofrom
nmorabowen:up/04-domain-clearall-eq-leak

Conversation

@nmorabowen

Copy link
Copy Markdown

Domain::clearAll() (called by wipe()) empties every tagged-object container it owns — elements, nodes, SP/PC/MP constraints, load patterns, parameters — except theEQs. So EQ_Constraint objects survived a wipe: never freed (leak), and since theEQs->getNumComponents() stayed nonzero the domain still reported itself non-empty afterward.

Fix: add the missing theEQs->clearAll() next to the other constraint containers. No effect on a model that holds no EQ_Constraints.

Authors: Nicolas Mora Bowen, Patricio Palacios, José A. Abell

Domain::clearAll() (invoked by wipe()) empties every tagged-object container it
owns -- elements, nodes, SP/PC/MP constraints, load patterns, parameters --
except theEQs. The EQ_Constraint objects therefore survived a wipe: they were
never freed (memory leak) and, because getNumComponents() stayed nonzero, the
domain still reported itself as non-empty afterward. Add the missing
theEQs->clearAll() alongside the other constraint containers. No effect on a
model that holds no EQ_Constraints.

Co-authored-by: Patricio Palacios <pxpalacios@miuandes.cl>
Co-authored-by: Jose A. Abell <jaabell@miuandes.cl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant