Salome HOME
Updated events for Model and minor other changes
[modules/shaper.git] / src / Model / Model_Application.cxx
index 260db7d444ae0841f47903849630f20e3eb95b01..a8c8966b3962cb43eb08f6e3e72faea022fc9ffa 100644 (file)
@@ -25,14 +25,14 @@ Handle(Model_Application) Model_Application::getApplication()
 //function : getDocument
 //purpose  : 
 //=======================================================================
-std::shared_ptr<Model_Document> Model_Application::getDocument(string theDocID)
+const std::shared_ptr<Model_Document>& Model_Application::getDocument(string theDocID)
 {
   if (myDocs.find(theDocID) != myDocs.end())
     return myDocs[theDocID];
 
   std::shared_ptr<Model_Document> aNew(new Model_Document(theDocID));
   myDocs[theDocID] = aNew;
-  return aNew;
+  return myDocs[theDocID];
 }
 
 void Model_Application::deleteDocument(string theDocID)