linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Double de-alloc in linphone_chat_room_destroy?


From: Henrik Husted
Subject: [Linphone-developers] Double de-alloc in linphone_chat_room_destroy?
Date: Mon, 15 Dec 2014 16:40:16 +0100

Hi

I'm seeing a strange double dealloc inside linphone_chat_room_destroy() that I cant explain.

What I'm doing is pretty simple (in pseudo code):

chatroom = linphone_core_create_chat_room()
linphone_chat_room_destroy(chatroom)

This causes the chatroom object to be deallocated twice. First inside this function:

static void _linphone_chat_room_destroy(LinphoneChatRoom *cr){
   <snip>
    ms_free(cr); <-- chatroom dealloc
}

and then also at the end of this function

void belle_sip_object_delete(void *ptr){
    belle_sip_object_t *obj=BELLE_SIP_OBJECT(ptr);
    belle_sip_object_vptr_t *vptr;

    belle_sip_object_loose_weak_refs(obj);
    remove_free_object(obj);
    vptr=obj->vptr;
    while(vptr!=NULL){
        if (vptr->destroy) vptr->destroy(obj); <-- calls _linphone_chat_room_destroy
        vptr=vptr->get_parent();
    }
    belle_sip_object_data_clear(obj);
    belle_sip_free(obj);  <-- chatroom dealloc again
}

If I remove the dealloc from _linphone_chat_room_destroy() then there's no double dealloc.
Am I doing something wrong? Seems strange that no-one else is seeing this.

/Henrik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]