Commit c41132f3 authored by Ghislain MARY's avatar Ghislain MARY

Fix memory leak with c-wrapper for calls.

parent d8c2df97
......@@ -3728,7 +3728,7 @@ LinphoneStatus linphone_core_decline_call(LinphoneCore *lc, LinphoneCall *call,
const bctbx_list_t *linphone_core_get_calls(LinphoneCore *lc) {
if (lc->callsCache) {
bctbx_list_free(lc->callsCache);
bctbx_list_free_with_data(lc->callsCache, (bctbx_list_free_func)linphone_call_unref);
lc->callsCache = NULL;
}
lc->callsCache = L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getCalls());
......
......@@ -42,6 +42,6 @@ static void _linphone_core_constructor (LinphoneCore *lc) {
static void _linphone_core_destructor (LinphoneCore *lc) {
if (lc->callsCache)
bctbx_list_free(lc->callsCache);
bctbx_list_free_with_data(lc->callsCache, (bctbx_list_free_func)linphone_call_unref);
_linphone_core_uninit(lc);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment