Skip to content

Commit 9dfa9cf

Browse files
committed
Call audiosample_mark_deinit during deinitialization of audiosample objects.
1 parent ede320c commit 9dfa9cf

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

shared-module/audiodelays/Echo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55
// SPDX-License-Identifier: MIT
66
#include "shared-bindings/audiodelays/Echo.h"
7+
#include "shared-bindings/audiocore/__init__.h"
78

89
#include <stdint.h>
910
#include "py/runtime.h"
@@ -115,6 +116,7 @@ void common_hal_audiodelays_echo_deinit(audiodelays_echo_obj_t *self) {
115116
if (common_hal_audiodelays_echo_deinited(self)) {
116117
return;
117118
}
119+
audiosample_mark_deinit(&self->base);
118120
self->echo_buffer = NULL;
119121
self->buffer[0] = NULL;
120122
self->buffer[1] = NULL;

shared-module/audiodelays/PitchShift.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55
// SPDX-License-Identifier: MIT
66
#include "shared-bindings/audiodelays/PitchShift.h"
7+
#include "shared-bindings/audiocore/__init__.h"
78

89
#include <stdint.h>
910
#include "py/runtime.h"
@@ -105,6 +106,7 @@ void common_hal_audiodelays_pitch_shift_deinit(audiodelays_pitch_shift_obj_t *se
105106
if (common_hal_audiodelays_pitch_shift_deinited(self)) {
106107
return;
107108
}
109+
audiosample_mark_deinit(&self->base);
108110
self->window_buffer = NULL;
109111
self->overlap_buffer = NULL;
110112
self->buffer[0] = NULL;

shared-module/audiofilters/Distortion.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <math.h>
1111
#include "shared-bindings/audiofilters/Distortion.h"
1212
#include "shared-module/audiofilters/Distortion.h"
13+
#include "shared-bindings/audiocore/__init__.h"
1314

1415
/**
1516
* Based on Godot's AudioEffectDistortion
@@ -81,6 +82,7 @@ bool common_hal_audiofilters_distortion_deinited(audiofilters_distortion_obj_t *
8182
}
8283

8384
void common_hal_audiofilters_distortion_deinit(audiofilters_distortion_obj_t *self) {
85+
audiosample_mark_deinit(&self->base);
8486
self->buffer[0] = NULL;
8587
self->buffer[1] = NULL;
8688
}

shared-module/audiofilters/Filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55
// SPDX-License-Identifier: MIT
66
#include "shared-bindings/audiofilters/Filter.h"
7+
#include "shared-bindings/audiocore/__init__.h"
78

89
#include "shared-module/synthio/BlockBiquad.h"
910
#include <stdint.h>
@@ -67,6 +68,7 @@ void common_hal_audiofilters_filter_deinit(audiofilters_filter_obj_t *self) {
6768
if (common_hal_audiofilters_filter_deinited(self)) {
6869
return;
6970
}
71+
audiosample_mark_deinit(&self->base);
7072
self->buffer[0] = NULL;
7173
self->buffer[1] = NULL;
7274
self->filter = mp_const_none;

shared-module/audiomixer/Mixer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "py/runtime.h"
1313
#include "shared-module/audiocore/__init__.h"
14+
#include "shared-bindings/audiocore/__init__.h"
1415

1516
#if defined(__arm__) && __arm__
1617
#include "cmsis_compiler.h"
@@ -47,6 +48,7 @@ void common_hal_audiomixer_mixer_construct(audiomixer_mixer_obj_t *self,
4748
}
4849

4950
void common_hal_audiomixer_mixer_deinit(audiomixer_mixer_obj_t *self) {
51+
audiosample_mark_deinit(&self->base);
5052
self->first_buffer = NULL;
5153
self->second_buffer = NULL;
5254
}

0 commit comments

Comments
 (0)