From: Mathnerd314 Date: Thu, 4 Mar 2010 02:42:48 +0000 (+0000) Subject: Minor cleanup in SoundManager X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6bd158996008d0d0402b0564b4745a92ff4c3e13;p=supertux.git Minor cleanup in SoundManager SVN-Revision: 6539 --- diff --git a/src/audio/sound_manager.cpp b/src/audio/sound_manager.cpp index 6bd2c31d1..a7f32d864 100644 --- a/src/audio/sound_manager.cpp +++ b/src/audio/sound_manager.cpp @@ -54,12 +54,14 @@ SoundManager::SoundManager() : sound_enabled = true; music_enabled = true; } catch(std::exception& e) { - if(context != NULL) + if(context != NULL) { alcDestroyContext(context); - context = NULL; - if(device != NULL) + context = NULL; + } + if(device != NULL) { alcCloseDevice(device); - device = NULL; + device = NULL; + } log_warning << "Couldn't initialize audio device: " << e.what() << std::endl; print_openal_version(); } @@ -80,9 +82,11 @@ SoundManager::~SoundManager() if(context != NULL) { alcDestroyContext(context); + context = NULL; } if(device != NULL) { alcCloseDevice(device); + device = NULL; } } @@ -254,7 +258,7 @@ SoundManager::enable_music(bool enable) } else { if(music_source) { delete music_source; - music_source = 0; + music_source = NULL; } } }