Skip to content

Commit 478aa7e

Browse files
committed
free memory afer disabling the usb ISR solves race condition which could corrupt the heap. (issue #1049)
1 parent 2198e68 commit 478aa7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/USBDevice/USBMSD/USBMSD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ bool USBMSD::connect(bool blocking) {
135135
}
136136

137137
void USBMSD::disconnect() {
138+
USBDevice::disconnect();
138139
//De-allocate MSD page size:
139140
free(page);
140141
page = NULL;
141-
USBDevice::disconnect();
142142
}
143143

144144
void USBMSD::reset() {

0 commit comments

Comments
 (0)