Skip to content

Commit ed54e9d

Browse files
committed
audio: Call audiosample_mark_deinit.
Also remove the deinited check when it's safe to do all deinit actions again.
1 parent 5c70dc0 commit ed54e9d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

shared-module/audiodelays/Chorus.c

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

89
#include <stdint.h>
910
#include <math.h>
@@ -104,9 +105,7 @@ bool common_hal_audiodelays_chorus_deinited(audiodelays_chorus_obj_t *self) {
104105
}
105106

106107
void common_hal_audiodelays_chorus_deinit(audiodelays_chorus_obj_t *self) {
107-
if (common_hal_audiodelays_chorus_deinited(self)) {
108-
return;
109-
}
108+
audiosample_mark_deinit(&self->base);
110109
self->chorus_buffer = NULL;
111110
self->buffer[0] = NULL;
112111
self->buffer[1] = NULL;

shared-module/audiofreeverb/Freeverb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// Fixed point ideas from - Paul Stoffregen in the Teensy audio library https://github.com/PaulStoffregen/Audio/blob/master/effect_freeverb.cpp
99
//
1010
#include "shared-bindings/audiofreeverb/Freeverb.h"
11+
#include "shared-bindings/audiocore/__init__.h"
1112
#include "shared-module/synthio/__init__.h"
1213

1314
#include <stdint.h>
@@ -124,9 +125,7 @@ bool common_hal_audiofreeverb_freeverb_deinited(audiofreeverb_freeverb_obj_t *se
124125
}
125126

126127
void common_hal_audiofreeverb_freeverb_deinit(audiofreeverb_freeverb_obj_t *self) {
127-
if (common_hal_audiofreeverb_freeverb_deinited(self)) {
128-
return;
129-
}
128+
audiosample_mark_deinit(&self->base);
130129
self->buffer[0] = NULL;
131130
self->buffer[1] = NULL;
132131
}

0 commit comments

Comments
 (0)