| 1724 | //----------------------------------------------------------------------------- |
| 1725 | |
| 1726 | void ModuleManager::clearDatabase( void ) |
| 1727 | { |
| 1728 | // Lock database. |
| 1729 | AssertFatal( mDatabaseLocks == 0, "Cannot clear database if database is locked." ); |
| 1730 | |
| 1731 | // Iterate groups loaded. |
| 1732 | while ( mGroupsLoaded.size() > 0 ) |
| 1733 | { |
| 1734 | // Unload module group. |
| 1735 | unloadModuleGroup( *mGroupsLoaded.begin() ); |
| 1736 | } |
| 1737 | |
| 1738 | // Iterate any other explicit modules that are loaded. |
| 1739 | while ( mModulesLoaded.size() > 0 ) |
| 1740 | { |
| 1741 | // Fetch module definition. |
| 1742 | ModuleDefinition* pModuleDefinition = mModulesLoaded.begin()->mpModuleDefinition; |
| 1743 | |
| 1744 | // Unload explicit module. |
| 1745 | unloadModuleExplicit( pModuleDefinition->getModuleId() ); |
| 1746 | } |
| 1747 | |
| 1748 | // Iterate modules to delete module definitions. |
| 1749 | for ( typeModuleIdDatabaseHash::iterator moduleItr = mModuleIdDatabase.begin(); moduleItr != mModuleIdDatabase.end(); ++moduleItr ) |
| 1750 | { |
| 1751 | // Fetch modules definitions. |
| 1752 | ModuleDefinitionEntry* pDefinitions = moduleItr->value; |
| 1753 | |
| 1754 | // Iterate module definitions. |
| 1755 | for ( ModuleDefinitionEntry::iterator definitionItr = pDefinitions->begin(); definitionItr != pDefinitions->end(); ++definitionItr ) |
| 1756 | { |
| 1757 | // Fetch module definition. |
| 1758 | ModuleDefinition* pModuleDefinition = *definitionItr; |
| 1759 | |
| 1760 | // Remove notification before we delete it. |
| 1761 | clearNotify( pModuleDefinition ); |
| 1762 | |
| 1763 | // Delete module definition. |
| 1764 | pModuleDefinition->deleteObject(); |
| 1765 | } |
| 1766 | |
| 1767 | // Clear definitions. |
| 1768 | delete pDefinitions; |
| 1769 | } |
| 1770 | |
| 1771 | // Clear database. |
| 1772 | mModuleIdDatabase.clear(); |
| 1773 | |
| 1774 | // Iterate module groups. |
| 1775 | for ( typeGroupModuleHash::iterator moduleGroupItr = mGroupModules.begin(); moduleGroupItr != mGroupModules.end(); ++moduleGroupItr ) |
| 1776 | { |
| 1777 | // Delete module group vector. |
| 1778 | delete moduleGroupItr->value; |
| 1779 | } |
| 1780 | |
| 1781 | // Clear module groups. |
| 1782 | mGroupModules.clear(); |
| 1783 | } |
nothing calls this directly
no test coverage detected