From 00b364756aa7caf6206dd96fb2bcd1459c37312e Mon Sep 17 00:00:00 2001 From: mathnerd314 Date: Thu, 4 Mar 2010 02:42:48 +0000 Subject: [PATCH] Minor cleanup in SoundManager git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6539 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- src/audio/sound_manager.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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; } } } -- 2.11.0