Salome HOME
Merge branch 'Dev_2.1.0' of salome:modules/shaper into Dev_2.1.0
[modules/shaper.git] / src / Events / Events_Loop.cpp
index f9b9d004626bb4dbfe9c16cf12266277f9a60793..d2d96de532ceda5a4c43bb051fadad2a3ebb7f21 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:       Events_Loop.hxx
 // Created:    Thu Mar 13 2014
 // Author:     Mikhail PONIKAROV
@@ -125,14 +127,30 @@ void Events_Loop::flush(const Events_ID& theID)
     std::shared_ptr<Events_Message> aGroup = aMyGroup->second;
     myGroups.erase(aMyGroup);
     send(aGroup, false);
+
     if (!aWasFlushed)
-      myFlushed.erase(myFlushed.find(theID.myID));
+      // TODO: Stabilization fix. Check later.
+      if(myFlushed.find(theID.myID) != myFlushed.end()) {
+        myFlushed.erase(myFlushed.find(theID.myID));
+      }
+  }
+}
+
+void Events_Loop::eraseMessages(const Events_ID& theID)
+{
+  std::map<char*, std::shared_ptr<Events_Message> >::iterator aMyGroup =
+    myGroups.find(theID.eventText());
+  if (aMyGroup != myGroups.end()) {
+    myGroups.erase(aMyGroup);
   }
 }
 
-void Events_Loop::activateFlushes(const bool theActivate)
+
+bool Events_Loop::activateFlushes(const bool theActivate)
 {
+  bool isActive = myFlushActive;
   myFlushActive = theActivate;
+  return isActive;
 }
 
 void Events_Loop::clear(const Events_ID& theID)