You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fix test memory leaks
This commit is contained in:
@@ -110,6 +110,8 @@ TEST_CASE( "Fake_Frame", "[libopenshot][dummyreader]" ) {
|
||||
|
||||
// Add test frame to dummy reader
|
||||
cache.Add(f);
|
||||
|
||||
delete[] audio_buffer;
|
||||
}
|
||||
|
||||
// Create a default fraction (should be 1/1)
|
||||
|
||||
@@ -238,7 +238,7 @@ TEST_CASE( "resample_audio_mapper", "[libopenshot][framemapper]" ) {
|
||||
// Create blank frame (with specific frame #, samples, and channels)
|
||||
// Sample count should be 44100 / 30 fps = 1470 samples per frame
|
||||
int sample_count = 1470;
|
||||
std::shared_ptr<openshot::Frame> f(new openshot::Frame(frame_number, sample_count, 2));
|
||||
auto f = std::make_shared<openshot::Frame>(frame_number, sample_count, 2);
|
||||
|
||||
// Create test samples with sin wave (predictable values)
|
||||
float *audio_buffer = new float[sample_count * 2];
|
||||
@@ -256,6 +256,8 @@ TEST_CASE( "resample_audio_mapper", "[libopenshot][framemapper]" ) {
|
||||
|
||||
// Add test frame to dummy reader
|
||||
cache.Add(f);
|
||||
|
||||
delete[] audio_buffer;
|
||||
}
|
||||
|
||||
// Create a default fraction (should be 1/1)
|
||||
@@ -377,7 +379,7 @@ TEST_CASE( "redistribute_samples_per_frame", "[libopenshot][framemapper]" ) {
|
||||
// Create blank frame (with specific frame #, samples, and channels)
|
||||
// Sample count should be 44100 / 30 fps = 1470 samples per frame
|
||||
int sample_count = 1470;
|
||||
std::shared_ptr<openshot::Frame> f(new openshot::Frame(frame_number, sample_count, 2));
|
||||
auto f = std::make_shared<openshot::Frame>(frame_number, sample_count, 2);
|
||||
|
||||
// Create test samples with incrementing value
|
||||
float *audio_buffer = new float[sample_count];
|
||||
@@ -394,6 +396,8 @@ TEST_CASE( "redistribute_samples_per_frame", "[libopenshot][framemapper]" ) {
|
||||
|
||||
// Add test frame to dummy reader
|
||||
cache.Add(f);
|
||||
|
||||
delete[] audio_buffer;
|
||||
}
|
||||
|
||||
// Create a default fraction (should be 1/1)
|
||||
|
||||
Reference in New Issue
Block a user