From 5a2e82b6ec9945c11a57dd63559bef2f219f4abe Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 29 Jul 2014 10:47:45 +0400 Subject: [PATCH] Debug of opening document with sketch --- src/Model/Model_Update.cpp | 3 +++ src/Model/Model_Update.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index a50f19c6a..070e5a8c0 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -24,6 +24,8 @@ Model_Update::Model_Update() void Model_Update::processEvent(const Events_Message* theMessage) { + if (isExecuted) return; // nothing to do: it is executed now + isExecuted = true; const ModelAPI_ObjectUpdatedMessage* aMsg = dynamic_cast(theMessage); myInitial = aMsg->objects(); @@ -48,6 +50,7 @@ void Model_Update::processEvent(const Events_Message* theMessage) // flush static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); Events_Loop::loop()->flush(EVENT_DISP); + isExecuted = false; } bool Model_Update::updateFeature(FeaturePtr theFeature) diff --git a/src/Model/Model_Update.h b/src/Model/Model_Update.h index f96bbf8ad..e5851910f 100644 --- a/src/Model/Model_Update.h +++ b/src/Model/Model_Update.h @@ -24,6 +24,8 @@ class Model_Update : public Events_Listener std::set > myInitial; ///< already updated and processed features and modificated feature flag std::map, bool> myUpdated; + ///< to know that all next updates are caused by this execution + bool isExecuted; public: /// Is called only once, on startup of the application Model_Update(); -- 2.39.2