Skip to content

Commit

Permalink
- Remove the LibraryComponent object when we delete the class.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23308 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Nov 11, 2014
1 parent 4fd8b91 commit 8e76bb5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -1005,6 +1005,10 @@ void LibraryTreeWidget::unloadClassHelper(LibraryTreeNode *pLibraryTreeNode)
mpMainWindow->getOMCProxy()->removeCachedOMCCommand(pChildLibraryTreeNode->getNameStructure());
mLibraryTreeNodesList.removeOne(pChildLibraryTreeNode);
mExpandedLibraryTreeNodesList.removeOne(pChildLibraryTreeNode);
LibraryComponent *pLibraryComponent = getLibraryComponentObject(pChildLibraryTreeNode->getNameStructure());
if (pLibraryComponent) {
mLibraryComponentsList.removeOne(pLibraryComponent);
}
unloadClassHelper(pChildLibraryTreeNode);
}
}
Expand Down Expand Up @@ -1462,6 +1466,10 @@ void LibraryTreeWidget::unloadLibraryTreeNodeAndModelWidget(LibraryTreeNode *pLi
qDeleteAll(pLibraryTreeNode->takeChildren());
mLibraryTreeNodesList.removeOne(pLibraryTreeNode);
mExpandedLibraryTreeNodesList.removeOne(pLibraryTreeNode);
LibraryComponent *pLibraryComponent = getLibraryComponentObject(pLibraryTreeNode->getNameStructure());
if (pLibraryComponent) {
mLibraryComponentsList.removeOne(pLibraryComponent);
}
/* Update the model switcher toolbar button. */
mpMainWindow->updateModelSwitcherMenu(0);
delete pLibraryTreeNode;
Expand Down

0 comments on commit 8e76bb5

Please sign in to comment.