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=00b364756aa7caf6206dd96fb2bcd1459c37312e;p=supertux.git Minor cleanup in SoundManager git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6539 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- 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; } } }