]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2027 Modification of data strtucture outside of transaction when create circle...
authornds <nds@opencascade.com>
Thu, 30 Mar 2017 08:10:52 +0000 (11:10 +0300)
committernds <nds@opencascade.com>
Thu, 30 Mar 2017 08:11:41 +0000 (11:11 +0300)
Modification is proposed by MPV

src/Model/Model_Document.cpp

index 0eea8c4ffab630248643358d8c8a1f1c6dfefbc6..9ff99fbadec1172a177c96a9e2e02a008e17e6f5 100755 (executable)
@@ -554,7 +554,6 @@ bool Model_Document::finishOperation()
     static std::shared_ptr<Events_Message> aFinishMsg
       (new Events_Message(Events_Loop::eventByName("FinishOperation")));
     Events_Loop::loop()->send(aFinishMsg);
-    Events_Loop::loop()->autoFlush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED), false);
   }
   // to avoid "updated" message appearance by updater
   //aLoop->clear(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
@@ -567,6 +566,11 @@ bool Model_Document::finishOperation()
     if (subDoc(*aSubIter)->finishOperation())
       aResult = true;
 
+  // sub-Part may send updated by flush of deleted (macro circle)
+  if (isRoot()) { // once for root document
+    Events_Loop::loop()->autoFlush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED), false);
+  }
+
   // transaction may be empty if this document was created during this transaction (create part)
   if (!myTransactions.empty() && myDoc->CommitCommand()) {
     // if commit is successfull, just increment counters