Changeset 7855 for code/trunk/src
- Timestamp:
- Feb 11, 2011, 2:20:13 PM (14 years ago)
- Location:
- code/trunk/src/orxonox/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/sound/SoundManager.cc
r7284 r7855 70 70 { 71 71 RegisterRootObject(SoundManager); 72 73 this->bDestructorCalled_ = false; 72 74 73 75 // See whether we even want to load … … 163 165 { 164 166 // Erase fade lists because of the smart pointers 167 this->bDestructorCalled_ = true; 165 168 this->fadeInList_.clear(); 166 169 this->fadeOutList_.clear(); … … 343 346 void SoundManager::registerAmbientSound(AmbientSound* newAmbient) 344 347 { 345 if (newAmbient != NULL )348 if (newAmbient != NULL && !this->bDestructorCalled_) 346 349 { 347 350 for (AmbientList::const_iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it) … … 366 369 void SoundManager::unregisterAmbientSound(AmbientSound* oldAmbient) 367 370 { 368 if (oldAmbient == NULL || ambientSounds_.empty() )371 if (oldAmbient == NULL || ambientSounds_.empty() || this->bDestructorCalled_) 369 372 return; 370 373 -
code/trunk/src/orxonox/sound/SoundManager.h
r6417 r7855 146 146 std::vector<ALuint> availableSoundSources_; 147 147 std::vector<std::pair<ALuint, BaseSound*> > usedSoundSources_; 148 149 bool bDestructorCalled_; ///< Becomes true if the destructor is called - used to prevent ambient sounds from registering after the lists were cleared 148 150 149 151 static SoundManager* singletonPtr_s;
Note: See TracChangeset
for help on using the changeset viewer.