- std::list<std::shared_ptr<ModelAPI_Document> > aUsedDocs = allOpenedDocuments();
- Model_Application::getApplication()->removeUselessDocuments(aUsedDocs);
+ // MPV: this code is dangerous now because it may close the document that is activated right now
+ // but not in the list of the opened documents yet (create, delete, undo, activate Part)
+ // later this must be updated by correct usage of uniques IDs of documents, not names of results
+ //std::list<std::shared_ptr<ModelAPI_Document> > aUsedDocs = allOpenedDocuments();
+ //Model_Application::getApplication()->removeUselessDocuments(aUsedDocs);