Merge pull request #3284 from dhalbert/fix-3171-evt-handler

Remove event handler before setting it to NULL
This commit is contained in:
Scott Shawcroft 2020-08-17 15:02:29 -07:00 committed by GitHub
commit 377503e61c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -483,8 +483,8 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t*
err_code = sd_ble_gap_scan_start(&scan_params, sd_data);
if (err_code != NRF_SUCCESS) {
self->scan_results = NULL;
ble_drv_remove_event_handler(scan_on_ble_evt, self->scan_results);
self->scan_results = NULL;
check_nrf_error(err_code);
}