File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2982,8 +2982,12 @@ void TreeWidget::onUpdateStatus()
2982
2982
2983
2983
std::vector<App::DocumentObject*> errors;
2984
2984
2985
+ // Use a local copy in case of nested calls
2986
+ auto localNewObjects = NewObjects;
2987
+ NewObjects.clear ();
2988
+
2985
2989
// Checking for new objects
2986
- for (auto & v : NewObjects ) {
2990
+ for (auto & v : localNewObjects ) {
2987
2991
auto doc = App::GetApplication ().getDocument (v.first .c_str ());
2988
2992
if (!doc)
2989
2993
continue ;
@@ -3006,10 +3010,13 @@ void TreeWidget::onUpdateStatus()
3006
3010
docItem->createNewItem (*vpd);
3007
3011
}
3008
3012
}
3009
- NewObjects.clear ();
3013
+
3014
+ // Use a local copy in case of nested calls
3015
+ auto localChangedObjects = ChangedObjects;
3016
+ ChangedObjects.clear ();
3010
3017
3011
3018
// Update children of changed objects
3012
- for (auto & v : ChangedObjects ) {
3019
+ for (auto & v : localChangedObjects ) {
3013
3020
auto obj = v.first ;
3014
3021
3015
3022
auto iter = ObjectTable.find (obj);
@@ -3035,7 +3042,6 @@ void TreeWidget::onUpdateStatus()
3035
3042
3036
3043
updateChildren (iter->first , iter->second , v.second .test (CS_Output), false );
3037
3044
}
3038
- ChangedObjects.clear ();
3039
3045
3040
3046
FC_LOG (" update item status" );
3041
3047
TimingInit ();
You can’t perform that action at this time.
0 commit comments