Commit 2cf1fe0f authored by Simon Morlat's avatar Simon Morlat

fix last commit

parent 0c6ff18a
......@@ -131,12 +131,6 @@ void belle_sip_object_unref(void *ptr){
belle_sip_fatal("Fatal object error encountered, aborting.");
return;
}
if (obj->vptr->on_last_ref){
if ((obj->vptr->initially_unowned && obj->ref==0)
|| (!obj->vptr->initially_unowned && obj->ref == 1)){
obj->vptr->on_last_ref(obj);
}
}
if (obj->vptr->initially_unowned && obj->ref==0){
if (obj->pool)
......@@ -145,7 +139,15 @@ void belle_sip_object_unref(void *ptr){
belle_sip_object_delete(obj);
return;
}
obj->ref--;
if (obj->vptr->on_last_ref){
if ((obj->vptr->initially_unowned && obj->ref==0)
|| (!obj->vptr->initially_unowned && obj->ref == 1)){
obj->vptr->on_last_ref(obj);
}
}
if (obj->ref == 0){
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