X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Application.cpp;h=4dddb449daf686c24185616677b8f45a6df6bed1;hb=dc19b4c930a9c2cf5db509fc81586deab00e7417;hp=60bf41d9fa4f9cd1bd5600c126ae1dd77eb4a869;hpb=96912644cf6607688466ac69f1f098fd2fff37b7;p=modules%2Fshaper.git diff --git a/src/Model/Model_Application.cpp b/src/Model/Model_Application.cpp index 60bf41d9f..4dddb449d 100644 --- a/src/Model/Model_Application.cpp +++ b/src/Model/Model_Application.cpp @@ -33,14 +33,14 @@ const std::shared_ptr& Model_Application::getDocument(string the bool isRoot = theDocID == "root"; // the document is root std::shared_ptr aNew( new Model_Document(theDocID, isRoot ? thePartSetKind : thePartKind)); - aNew->setThis(aNew); myDocs[theDocID] = aNew; // 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)); @@ -64,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();