]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/soundmgr_openal.cxx
Melchior FRANZ:
[simgear.git] / simgear / sound / soundmgr_openal.cxx
index 0785edb5a63c7193a8fe74ca15cd4ab5ae468041..b525b31fb4f9a531c08027c54b22650796f805cc 100644 (file)
@@ -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();
 }