Skip to content

Commit c22a209

Browse files
doudarh2zero
authored andcommitted
Initialize semaphore with braces in NimBLEUtils
Fixes a connect crash in the client
1 parent e0c8f5a commit c22a209

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/NimBLEUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bool NimBLEUtils::taskWait(const TaskData& taskData, uint32_t timeout) {
9595
}
9696

9797
if (taskData.m_pSem == nullptr) {
98-
auto* sem = new ble_npl_sem;
98+
auto* sem = new ble_npl_sem{};
9999
if (ble_npl_sem_init(sem, 0) != BLE_NPL_OK) {
100100
NIMBLE_LOGE(LOG_TAG, "Failed to initialize semaphore for taskWait");
101101
delete sem;

0 commit comments

Comments
 (0)