File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
targets/ESP32/_nanoCLR/nanoFramework.Device.Bluetooth Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -474,8 +474,18 @@ void Device_ble_dispose()
474474 }
475475
476476 BLE_DEBUG_PRINTF (" delete mutexs\n " );
477- vEventGroupDelete (ble_event_waitgroup);
478- vSemaphoreDelete (ble_event_data.mutex );
477+
478+ if (ble_event_waitgroup)
479+ {
480+ vEventGroupDelete (ble_event_waitgroup);
481+ }
482+ if (ble_event_data.mutex )
483+ {
484+ vSemaphoreDelete (ble_event_data.mutex );
485+ }
486+
487+ ble_event_waitgroup = NULL ;
488+ ble_event_data.mutex = NULL ;
479489
480490 ble_initialized = false ;
481491
@@ -507,6 +517,12 @@ bool DeviceBleInit()
507517 ble_event_waitgroup = xEventGroupCreate ();
508518 ble_event_data.mutex = xSemaphoreCreateMutex ();
509519
520+ if (!ble_event_waitgroup || !ble_event_data.mutex )
521+ {
522+ BLE_DEBUG_PRINTF (" Ble Event Wait Group or mutex is null\n " );
523+ return false ;
524+ }
525+
510526 nimble_port_init ();
511527
512528 // Initialize the NimBLE host configuration
You can’t perform that action at this time.
0 commit comments