Fix memory leak with c-wrapper for calls.

This commit is contained in:
Ghislain MARY 2018-01-08 15:05:47 +01:00
parent d8c2df970b
commit c41132f31d
2 changed files with 2 additions and 2 deletions

View file

@ -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());

View file

@ -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);
}