Skip to content

Commit c8b819a

Browse files
committed
pbio/drv/bluetooth: Fix duplicate reset handler reset.
Write after free is already protected wth the finalizer. We shouldn't be unsetting the notification handler from a static config struct. This caused notifications to be lost when running the program again. This only affected the Xbox Controller because the LWP3Device/Remote sets it every time.
1 parent d6479db commit c8b819a

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/pbio/drv/bluetooth/bluetooth.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,6 @@ pbio_error_t pbdrv_bluetooth_peripheral_disconnect(void) {
224224
return PBIO_SUCCESS;
225225
}
226226

227-
// Clear notification handler to avoid receiving further data.
228-
if (peri->config) {
229-
peri->config->notification_handler = NULL;
230-
}
231-
232227
// Initialize operation for handling on the main thread.
233228
peri->func = pbdrv_bluetooth_peripheral_disconnect_func;
234229
peri->err = PBIO_ERROR_AGAIN;

0 commit comments

Comments
 (0)