From 163a5a173acacb3bb66b28bb2f7af3b61695d5d6 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Fri, 27 Dec 2013 22:32:58 -0800 Subject: [PATCH] - bugfix when user has no sound device --- .../sources/sound/openal/sound_player_openal.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp index 1934af37..bec98732 100644 --- a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp +++ b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp @@ -455,9 +455,10 @@ void SoundPlayerOpenAL::end() { if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); - alcMakeContextCurrent( NULL ); - SoundPlayerOpenAL::checkAlcError(string(__FILE__) + string(" ") + string(__FUNCTION__) + string(" ") + intToStr(__LINE__)); - + if(context != 0) { + alcMakeContextCurrent( NULL ); + SoundPlayerOpenAL::checkAlcError(string(__FILE__) + string(" ") + string(__FUNCTION__) + string(" ") + intToStr(__LINE__)); + } if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); if(context != 0) {