Changeset 934 for code/branches/network/src/orxonox/Orxonox.cc
- Timestamp:
- Mar 27, 2008, 5:15:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/Orxonox.cc
r930 r934 46 46 //#include <exception> 47 47 #include <deque> 48 #define _CRTDBG_MAP_ALLOC49 #include <stdlib.h>50 #include <crtdbg.h>51 48 52 49 //***** ORXONOX **** … … 80 77 { 81 78 /** 79 @brief Reference to the only instance of the class. 80 */ 81 Orxonox *Orxonox::singletonRef_s = 0; 82 83 /** 82 84 * create a new instance of Orxonox 83 85 */ … … 85 87 { 86 88 this->ogre_ = new GraphicsEngine(); 89 this->timer_ = 0; 87 90 this->dataPath_ = ""; 88 91 this->auMan_ = 0; … … 105 108 delete this->orxonoxHUD_; 106 109 Loader::close(); 107 // do not destroy the InputHandler since this is a singleton too 108 // and might have been deleted already (after return 0; in main()) 110 InputHandler::destroy(); 109 111 if (this->auMan_) 110 112 delete this->auMan_; … … 142 144 Orxonox* Orxonox::getSingleton() 143 145 { 144 static Orxonox theOnlyInstance; 145 return &theOnlyInstance; 146 if (!singletonRef_s) 147 singletonRef_s = new Orxonox(); 148 return singletonRef_s; 149 //static Orxonox theOnlyInstance; 150 //return &theOnlyInstance; 151 } 152 153 /** 154 @brief Destroys the Orxonox singleton. 155 */ 156 void Orxonox::destroy() 157 { 158 if (singletonRef_s) 159 delete singletonRef_s; 160 singletonRef_s = 0; 146 161 } 147 162 … … 313 328 { 314 329 inputHandler_ = InputHandler::getSingleton(); 315 inputHandler_->initialise(ogre_->getWindowHandle(), 316 ogre_->getWindowWidth(), ogre_->getWindowHeight()); 330 if (!inputHandler_->initialise(ogre_->getWindowHandle(), 331 ogre_->getWindowWidth(), ogre_->getWindowHeight())) 332 abortImmediate(); 317 333 } 318 334
Note: See TracChangeset
for help on using the changeset viewer.