Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/module/PluginManager.cc

    r11017 r11071  
    5454    SetConsoleCommand("PluginManager", __CC_PluginManager_unload_name, &PluginManager::unloadPlugin);
    5555
    56     PluginManager* PluginManager::singletonPtr_s  = 0;
     56    PluginManager* PluginManager::singletonPtr_s  = nullptr;
    5757
    5858    RegisterAbstractClass(PluginManager).inheritsFrom<Configurable>();
     
    7070    PluginManager::~PluginManager()
    7171    {
    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);
    7474
    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;
    7979    }
    8080
     
    9696    {
    9797        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)
    9999        {
    100100            std::string name;
    101             std::string libraryName = (*it);
    102101            std::string filename = libraryName +  + specialConfig::pluginExtension;
    103102            std::ifstream infile(filename.c_str());
     
    117116    {
    118117        Plugin* plugin = this->plugins_[name];
    119         if (plugin != NULL)
     118        if (plugin != nullptr)
    120119            plugin->reference();
    121120        else
     
    126125    {
    127126        Plugin* plugin = this->plugins_[name];
    128         if (plugin != NULL)
     127        if (plugin != nullptr)
    129128            plugin->dereference(this->bMerelyDeactivatePlugins_);
    130129        else
     
    137136    void PluginManager::loadPlugin(const std::string& name)
    138137    {
    139         if (this->references_[name] == NULL)
     138        if (this->references_[name] == nullptr)
    140139        {
    141140            this->references_[name] = new PluginReference(name);
     
    152151    {
    153152        PluginReference* reference = this->references_[name];
    154         if (reference != NULL)
     153        if (reference != nullptr)
    155154        {
    156             this->references_[name] = NULL;
     155            this->references_[name] = nullptr;
    157156            delete reference;
    158157        }
Note: See TracChangeset for help on using the changeset viewer.