// 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<ModelAPI_DocumentCreatedMessage> aMessage = std::shared_ptr
<ModelAPI_DocumentCreatedMessage>(new ModelAPI_DocumentCreatedMessage(anId, this));
{
std::map<std::string, std::shared_ptr<Model_Document> >::iterator aDoc = myDocs.begin();
for(; aDoc != myDocs.end(); aDoc++) {
- aDoc->second->close();
+ aDoc->second->close(true);
}
myDocs.clear();
myLoadedByDemand.clear();