# include <simgear_config.h>
#endif
-#include <stdlib.h> // rand()
+#include <stdlib.h> // rand(), free()
#include <cstring>
#include <simgear/debug/logstream.hxx>
return SGPath(_refname);
}
-
+void SGSoundSample::free_data()
+{
+ if ( _data != NULL ) free( _data ); _data = NULL;
+}
* Constructor.
* @param data Pointer to a memory buffer containing this audio sample data
The application may free the data by calling free_data(), otherwise it
- will be resident untill the class is destroyed. This pointer will be
+ will be resident until the class is destroyed. This pointer will be
set to NULL after calling this function.
* @param len Byte length of array
* @param freq Frequency of the provided data (bytes per second)
/**
* Free the data associated with this audio sample
*/
- void free_data() {
- if ( _data != NULL ) free( _data ); _data = NULL;
- }
+ void free_data();
/**
* Set the source id of this source
/**
* Get a free OpenAL buffer-id
- * The buffer-id will be asigned to the sample by calling this function.
+ * The buffer-id will be assigned to the sample by calling this function.
* @param sample Pointer to an audio sample to assign the buffer-id to
* @return NO_BUFFER if loading of the buffer failed.
*/