]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/sample_openal.cxx
restore some part of the code to prevent an untwanted segmentationf fault.
[simgear.git] / simgear / sound / sample_openal.cxx
index d82c42a2f5080f9f104e93c9b1bff3ad3de34919..5fc257cc7ca83982ed518f98a66a9369b4f19dfb 100644 (file)
@@ -151,6 +151,10 @@ SGSoundSample::SGSoundSample( unsigned char *data, int len, int freq, int format
 
 // destructor
 SGSoundSample::~SGSoundSample() {
+    if (_data != NULL) {
+        delete _data;
+        _data = NULL;
+    }
 }
 
 void SGSoundSample::set_orientation( const SGQuatd& ori ) {