]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/soundmgr_openal.cxx
use auto_ptr instead
[simgear.git] / simgear / sound / soundmgr_openal.cxx
index e4cf60ff29c766fb3509a697b0657855c331c1cf..eb0a76e409d8b63a7eda13f0d1ee989b3aea05a0 100644 (file)
@@ -415,7 +415,10 @@ unsigned int SGSoundMgr::request_buffer(SGSoundSample *sample)
             void *data;
 
             load(sample_name, &data, &format, &size, &freq);
-            sample->set_data( (unsigned char *)data );
+            std::auto_ptr<unsigned char> ptr;
+            ptr.reset((unsigned char *)data);
+
+            sample->set_data( ptr );
             sample->set_frequency( freq );
             sample->set_format( format );
             sample->set_size( size );