From: ehofman Date: Sun, 21 Nov 2004 17:05:42 +0000 (+0000) Subject: Melchior FRANZ: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c19af3525eff22cb0f9947b7dfea67d3f6eec8a9;p=simgear.git Melchior FRANZ: At last I've found the reason why fgfs crashed routinely for me. When I still used KDE's artsdsp (preloads lib with OSS replacement functions) I saw this crash only occasionally. After letting OpenAl communicate with artsd directly (by means of ~/.openalrc setting), I got the crash always when I left fgfs. This bug may also have crashed fgfs when running with sound daemons other than aRts. --- diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 0785edb5..b525b31f 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -69,7 +69,8 @@ SGSoundMgr::SGSoundMgr() { // initialize OpenAL alutInit( 0, NULL ); - alGetError(); + atexit(alutExit); + if ( alGetError() == AL_NO_ERROR) { working = true; } else { @@ -119,8 +120,6 @@ SGSoundMgr::~SGSoundMgr() { SGSoundSample *sample = sample_current->second; delete sample; } - - alutExit(); } diff --git a/simgear/sound/xmlsound.cxx b/simgear/sound/xmlsound.cxx index 48a2d0ee..fbb4504a 100644 --- a/simgear/sound/xmlsound.cxx +++ b/simgear/sound/xmlsound.cxx @@ -80,11 +80,8 @@ SGXmlSound::~SGXmlSound() { _sample->stop(); - if (_property) - delete _property; - - if (_condition) - delete _condition; + delete _property; + delete _condition; _volume.clear(); _pitch.clear();