Editing geometry while onActivePathChanged
-
I'm using the
ModelObserver
'sonActivePathChanged
event to detect when components/groups are closed after editing. When that condition is met I call a method which deletes and adds some edges to a component definition in the model.However, when an edge is added or removed
onActivePathChanged
is called again for every change. And sinceonActivePathChanged
calls the method which causes the edges to be added or removed I now suddenly have an endless loop that runs until the call stack is full and SU bugsplats.onActivePathChanged -- calls --> updateComponentMethod updateComponentMethod -- when adding/removing edges; calls --> onActivePathChanged --> LOOP!!!
If I remove the lines that add or removed the edges the loop doesn't occur.
I have worked around it by setting a module variable when I start updating which makesonActivePathChanged
exit immediately if the update flag is set to true.But I don't understand at all why
onActivePathChanged
is called back when I add/remove edges. Some kind of weird bug?
Advertisement