]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/morse.cxx
Clean up some sound buffer allocation/deallocation issues.
[flightgear.git] / src / Sound / morse.cxx
index d2f9fc639017125413642faf26147a3d0f2d87e4..e88b2242aa6ae669eeea6aa058f3f8194a6925cb 100644 (file)
@@ -261,7 +261,12 @@ SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) {
 
     // 4. create the simple sound and return
     SGSoundSample *sample = new SGSoundSample( buffer, length,
-                                               BYTES_PER_SECOND );
+                                               BYTES_PER_SECOND,
+                                               false );
+
+    // clean up the buffer
+    delete [] buffer;
+
     sample->set_reference_dist( 10.0 );
     sample->set_max_dist( 20.0 );