Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 6, 2015, 10:43:12 AM (9 years ago)
Author:
landauf
Message:

unload modules, unload and destroy all statically initialized instances

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/Core.cc

    r10525 r10527  
    128128        // TODO: initialize CommandLineParser here
    129129        // TODO: initialize ConsoleCommandManager here
     130        // TODO: initialize NetworkFunctionManager here
    130131        this->rootModule_ = ModuleInstance::getCurrentModuleInstance();
    131132        this->rootModule_->loadAllStaticallyInitializedInstances();
     
    241242        safeObjectDelete(&languageInstance_);
    242243        safeObjectDelete(&configFileManager_);
     244        safeObjectDelete(&signalHandler_);
     245        Context::getRootContext()->unregisterObject(); // unregister context from object lists - otherwise the root context would be destroyed while unloading the root module
     246        if (this->rootModule_)
     247        {
     248            this->rootModule_->unloadAllStaticallyInitializedInstances();
     249            this->rootModule_->deleteAllStaticallyInitializedInstances();
     250        }
    243251        Context::setRootContext(NULL);
    244         safeObjectDelete(&signalHandler_);
    245 //        if (this->rootModule_)
    246 //            this->rootModule_->unloadAllStaticallyInitializedInstances();
    247 //        safeObjectDelete(&rootModule_);
     252        safeObjectDelete(&rootModule_);
    248253        safeObjectDelete(&dynLibManager_);
    249254        safeObjectDelete(&configurablePaths_);
     
    277282    void Core::loadModule(ModuleInstance* module)
    278283    {
     284        orxout(internal_info) << "Loading module " << module->getName() << "..." << endl;
     285
    279286        ModuleInstance::setCurrentModuleInstance(module);
    280287        DynLib* dynLib = this->dynLibManager_->load(module->getName());
     
    298305    void Core::unloadModule(ModuleInstance* module)
    299306    {
     307        orxout(internal_info) << "Unloading module " << module->getName() << "..." << endl;
     308
    300309        module->unloadAllStaticallyInitializedInstances();
    301310        module->deleteAllStaticallyInitializedInstances();
Note: See TracChangeset for help on using the changeset viewer.