}
}
+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);
+ }
+}
+
+
bool Events_Loop::activateFlushes(const bool theActivate)
{
bool isActive = myFlushActive;
//! Initializes sending of a group-message by the given ID
EVENTS_EXPORT void flush(const Events_ID& theID);
+ //! Removes messages with the given ID: they are not needed anymore (UPDATE on close)
+ EVENTS_EXPORT void eraseMessages(const Events_ID& theID);
+
//! Allows to disable flushes: needed in synchronization of document mechanism
//! (to synchronize all and only then flush create, update, etc in correct order)
//! \param theActivate a state about flushe is active. If false, the flush is disabled
myFeatures.UnBind(aFeaturesIter.Key());
}
aLoop->activateFlushes(isActive);
- aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ // erase update, because features are destroyed and update should not performed for them anywhere
+ aLoop->eraseMessages(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
+ aLoop->eraseMessages(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ // deleted and redisplayed is correctly performed: they know that features are destroyed
aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));