Content-Length: 277445 | pFad | http://github.com/adafruit/circuitpython/commit/eccc0889c55c74ef4cd4e85e525d6dadd651e4a3

9F Add guards to common_hal_pulseio_pulse(in|out)_deinit to prevent doub… · adafruit/circuitpython@eccc088 · GitHub
Skip to content

Commit eccc088

Browse files
committed
Add guards to common_hal_pulseio_pulse(in|out)_deinit to prevent double release of released resources.
1 parent 2896394 commit eccc088

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ports/espressif/common-hal/pulseio/PulseIn.c

+3
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t *self) {
127127
}
128128

129129
void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) {
130+
if (common_hal_pulseio_pulsein_deinited(self)) {
131+
return;
132+
}
130133
rmt_disable(self->channel);
131134
reset_pin_number(self->pin->number);
132135
rmt_del_channel(self->channel);

ports/espressif/common-hal/pulseio/PulseOut.c

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t *self) {
5454
}
5555

5656
void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) {
57+
if (common_hal_pulseio_pulseout_deinited(self)) {
58+
return;
59+
}
5760
rmt_disable(self->channel);
5861
rmt_del_encoder(self->encoder);
5962
rmt_del_channel(self->channel);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/adafruit/circuitpython/commit/eccc0889c55c74ef4cd4e85e525d6dadd651e4a3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy