Changeset 11016
- Timestamp:
- Jan 2, 2016, 4:06:30 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/cmake/LibraryConfigTardis.cmake
r9688 r11016 34 34 IF(TARDIS) 35 35 MESSAGE(STATUS "Running on D-ITET isg.ee Tardis Computer. Using customized paths.") 36 37 SET(DO_NOT_UNLOAD_PLUGINS ON) 36 38 37 39 # SET(CMAKE_C_COMPILER "gcc-4.1.1") -
code/trunk/src/SpecialConfig.h.in
r10624 r11016 51 51 52 52 #cmakedefine ORXONOX_USE_WINMAIN ///< Whether or not the console window is started as well 53 54 #cmakedefine DO_NOT_UNLOAD_PLUGINS ///< If defined then plugins are not unloaded (but merely deactivated) when the reference count drops to zero. 53 55 54 56 // Handle default ConfigValues -
code/trunk/src/libraries/core/module/PluginManager.cc
r11015 r11016 34 34 #include "Plugin.h" 35 35 #include "PluginReference.h" 36 #include "core/CoreIncludes.h" 36 37 #include "core/ApplicationPaths.h" 37 38 #include "core/command/ConsoleCommandIncludes.h" 39 #include "core/config/ConfigValueIncludes.h" 38 40 #include "core/object/Context.h" 41 42 #ifdef DO_NOT_UNLOAD_PLUGINS 43 # define MERELY_DEACTIVATE_PLUGINS true 44 #else 45 # define MERELY_DEACTIVATE_PLUGINS false 46 #endif 39 47 40 48 namespace orxonox … … 48 56 PluginManager* PluginManager::singletonPtr_s = 0; 49 57 58 RegisterAbstractClass(PluginManager).inheritsFrom<Configurable>(); 59 50 60 PluginManager::PluginManager() 51 61 { 62 RegisterObject(PluginManager); 63 52 64 ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(this); 53 65 ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(this); 66 67 this->setConfigValues(); 54 68 } 55 69 … … 63 77 for (std::map<std::string, Plugin*>::iterator it = this->plugins_.begin(); it != this->plugins_.end(); ++it) 64 78 delete it->second; 79 } 80 81 void PluginManager::setConfigValues() 82 { 83 SetConfigValue(bMerelyDeactivatePlugins_, MERELY_DEACTIVATE_PLUGINS); 65 84 } 66 85 … … 99 118 Plugin* plugin = this->plugins_[name]; 100 119 if (plugin != NULL) 101 plugin->dereference( false);120 plugin->dereference(this->bMerelyDeactivatePlugins_); 102 121 else 103 122 orxout(internal_warning) << "Cannot find plugin with name " << name << endl; -
code/trunk/src/libraries/core/module/PluginManager.h
r10580 r11016 35 35 #include <string> 36 36 #include "util/Singleton.h" 37 #include "core/config/Configurable.h" 37 38 38 39 namespace orxonox 39 40 { 40 class _CoreExport PluginManager : public Singleton<PluginManager> 41 class _CoreExport PluginManager : public Singleton<PluginManager>, public Configurable 41 42 { 42 43 friend class Singleton<PluginManager>; … … 45 46 PluginManager(); 46 47 ~PluginManager(); 48 49 void setConfigValues(); 47 50 48 51 void findPlugins(); … … 58 61 std::map<std::string, Plugin*> plugins_; 59 62 std::map<std::string, PluginReference*> references_; // references that were created by console command 63 bool bMerelyDeactivatePlugins_; 60 64 61 65 static PluginManager* singletonPtr_s;
Note: See TracChangeset
for help on using the changeset viewer.