Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc076fd7 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

btif_rc: Don't memset STL mutex objects

Switching to STL mutex/recursive_mutex objects left us with
code which memset these objects.  These are opaque, and need to
be initialized/destroyed via constructors/destructors, not
through directly setting their memory.

We change our memset calls to only zero out the parts of the
structs which don't have these objects.

Test: Recompile
Change-Id: Idf666e935f4094ad4cfca7cdafa523f777a7e769
parent 0c00b7db
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4904,7 +4904,7 @@ static void cleanup_ctrl()
        memset(&btif_rc_cb.rc_multi_cb[idx], 0, sizeof(btif_rc_cb.rc_multi_cb[idx]));
    }

    memset(&btif_rc_cb, 0, sizeof(rc_cb_t));
    memset(&btif_rc_cb.rc_multi_cb, 0, sizeof(btif_rc_cb.rc_multi_cb));
    BTIF_TRACE_EVENT("%s: completed", __func__);
}

@@ -6131,7 +6131,7 @@ static void initialize_transaction(int lbl)
*******************************************************************************/
void lbl_init()
{
    memset(&device,0,sizeof(rc_device_t));
    memset(&device.transaction, 0, sizeof(device.transaction));
    init_all_transactions();
}