Skip to content

Commit 2400134

Browse files
committed
gc all pointers in hid_devices properly
1 parent 9a7a2bb commit 2400134

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

shared-module/usb_hid/__init__.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,11 @@ void usb_hid_save_report_descriptor(uint8_t *report_descriptor_space, size_t rep
257257
void usb_hid_gc_collect(void) {
258258
gc_collect_ptr(hid_devices_tuple);
259259

260-
// Mark any heap pointers in the static device list as in use.
260+
// Mark possible heap pointers in the static device list as in use.
261261
for (mp_int_t i = 0; i < hid_devices_num; i++) {
262-
gc_collect_ptr(&hid_devices[i]);
262+
gc_collect_ptr(&hid_devices[i].report_descriptor);
263+
gc_collect_ptr(&hid_devices[i].in_report_buffer);
264+
gc_collect_ptr(&hid_devices[i].out_report_buffer);
263265
}
264266
}
265267

0 commit comments

Comments
 (0)