X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Application.cpp;h=4dddb449daf686c24185616677b8f45a6df6bed1;hb=cadc20ebc46d01b4d8ac0e91cc8e6fd1066867cb;hp=212fd4c9cab1ec924a6fe9fd14d2ced24b7a74ec;hpb=89575f2c6ddaa1b201166c046b0b1c03c16e4eb0;p=modules%2Fshaper.git diff --git a/src/Model/Model_Application.cpp b/src/Model/Model_Application.cpp index 212fd4c9c..4dddb449d 100644 --- a/src/Model/Model_Application.cpp +++ b/src/Model/Model_Application.cpp @@ -37,9 +37,10 @@ const std::shared_ptr& Model_Application::getDocument(string the // load it if it must be loaded by demand if (myLoadedByDemand.find(theDocID) != myLoadedByDemand.end() && !myPath.empty()) { - aNew->load(myPath.c_str()); + aNew->load(myPath.c_str(), aNew); myLoadedByDemand.erase(theDocID); // done, don't do it anymore } else { + aNew->setThis(aNew); static Events_ID anId = ModelAPI_DocumentCreatedMessage::eventId(); std::shared_ptr aMessage = std::shared_ptr (new ModelAPI_DocumentCreatedMessage(anId, this)); @@ -63,7 +64,7 @@ void Model_Application::deleteAllDocuments() { std::map >::iterator aDoc = myDocs.begin(); for(; aDoc != myDocs.end(); aDoc++) { - aDoc->second->close(); + aDoc->second->close(true); } myDocs.clear(); myLoadedByDemand.clear();