Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 930


Ignore:
Timestamp:
Mar 27, 2008, 12:45:47 AM (16 years ago)
Author:
rgrieder
Message:
  • fixed deletion bugs in regard to the singleton behavior
Location:
code/branches/network/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/InputHandler.cc

    r929 r930  
    129129  void InputHandler::destroy()
    130130  {
    131     if (!this->inputSystem_)
    132     {
    133       this->inputSystem_->destroyInputObject(this->mouse_);
    134       this->inputSystem_->destroyInputObject(this->keyboard_);
     131    if (this->mouse_)
     132      this->inputSystem_->destroyInputObject(mouse_);
     133    if (this->keyboard_)
     134      this->inputSystem_->destroyInputObject(keyboard_);
     135    if (this->inputSystem_)
    135136      OIS::InputManager::destroyInputSystem(this->inputSystem_);
    136     }
    137 
     137
     138    this->mouse_         = 0;
     139    this->keyboard_      = 0;
     140    this->inputSystem_   = 0;
    138141    this->uninitialized_ = true;
    139142  }
  • code/branches/network/src/orxonox/Orxonox.cc

    r929 r930  
    4646//#include <exception>
    4747#include <deque>
     48#define _CRTDBG_MAP_ALLOC
     49#include <stdlib.h>
     50#include <crtdbg.h>
    4851
    4952//***** ORXONOX ****
     
    97100  {
    98101    // keep in mind: the order of deletion is very important!
    99 
    100102    if (this->bulletMgr_)
    101103      delete this->bulletMgr_;
     
    103105      delete this->orxonoxHUD_;
    104106    Loader::close();
    105     this->inputHandler_->destroy();
     107    // do not destroy the InputHandler since this is a singleton too
     108    // and might have been deleted already (after return 0; in main())
    106109    if (this->auMan_)
    107110      delete this->auMan_;
Note: See TracChangeset for help on using the changeset viewer.