- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/core/module/PluginManager.cc
r11017 r11054 54 54 SetConsoleCommand("PluginManager", __CC_PluginManager_unload_name, &PluginManager::unloadPlugin); 55 55 56 PluginManager* PluginManager::singletonPtr_s = 0;56 PluginManager* PluginManager::singletonPtr_s = nullptr; 57 57 58 58 RegisterAbstractClass(PluginManager).inheritsFrom<Configurable>(); … … 70 70 PluginManager::~PluginManager() 71 71 { 72 ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject( NULL);73 ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject( NULL);72 ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(nullptr); 73 ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(nullptr); 74 74 75 for ( std::map<std::string, PluginReference*>::iterator it = this->references_.begin(); it != this->references_.end(); ++it)76 delete it->second;77 for ( std::map<std::string, Plugin*>::iterator it = this->plugins_.begin(); it != this->plugins_.end(); ++it)78 delete it->second;75 for (const auto& mapEntry : this->references_) 76 delete mapEntry.second; 77 for (const auto& mapEntry : this->plugins_) 78 delete mapEntry.second; 79 79 } 80 80 … … 96 96 { 97 97 const std::vector<std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths(); 98 for ( std::vector<std::string>::const_iterator it = pluginPaths.begin(); it != pluginPaths.end(); ++it)98 for (const std::string& libraryName : pluginPaths) 99 99 { 100 100 std::string name; 101 std::string libraryName = (*it);102 101 std::string filename = libraryName + + specialConfig::pluginExtension; 103 102 std::ifstream infile(filename.c_str()); … … 117 116 { 118 117 Plugin* plugin = this->plugins_[name]; 119 if (plugin != NULL)118 if (plugin != nullptr) 120 119 plugin->reference(); 121 120 else … … 126 125 { 127 126 Plugin* plugin = this->plugins_[name]; 128 if (plugin != NULL)127 if (plugin != nullptr) 129 128 plugin->dereference(this->bMerelyDeactivatePlugins_); 130 129 else … … 137 136 void PluginManager::loadPlugin(const std::string& name) 138 137 { 139 if (this->references_[name] == NULL)138 if (this->references_[name] == nullptr) 140 139 { 141 140 this->references_[name] = new PluginReference(name); … … 152 151 { 153 152 PluginReference* reference = this->references_[name]; 154 if (reference != NULL)153 if (reference != nullptr) 155 154 { 156 this->references_[name] = NULL;155 this->references_[name] = nullptr; 157 156 delete reference; 158 157 }
Note: See TracChangeset
for help on using the changeset viewer.