Commit 42dc5254 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

belle_sip_object.c: destroy object if ref count reaches 0 even if no pool is...

belle_sip_object.c: destroy object if ref count reaches 0 even if no pool is available for the given object (eg. in tester when no linphone core is instanciated)
parent 8115fd97
......@@ -71,7 +71,7 @@ int belle_sip_object_get_object_count(void){
void belle_sip_object_dump_active_objects(void){
belle_sip_list_t *elem;
if (all_objects){
belle_sip_message("List of leaked objects:");
for(elem=all_objects;elem!=NULL;elem=elem->next){
......@@ -125,7 +125,7 @@ void belle_sip_object_unref(void *ptr){
return;
}
obj->ref--;
if (obj->ref==0){
if (obj->ref<=0){ // Can be null OR negative when no pool is available and object is unowned
obj->ref=-1;
belle_sip_object_delete(obj);
}
......
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