Editing geometry while onActivePathChanged
-
I'm using the
ModelObserver'sonActivePathChangedevent 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
onActivePathChangedis called again for every change. And sinceonActivePathChangedcalls 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 makesonActivePathChangedexit immediately if the update flag is set to true.But I don't understand at all why
onActivePathChangedis called back when I add/remove edges. Some kind of weird bug?
Advertisement