From 6bd158996008d0d0402b0564b4745a92ff4c3e13 Mon Sep 17 00:00:00 2001 From: Mathnerd314 Date: Thu, 4 Mar 2010 02:42:48 +0000 Subject: [PATCH] Minor cleanup in SoundManager SVN-Revision: 6539 --- 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