Commit 0f999ecc authored by jehan's avatar jehan

add function to manually remove an object from leak detector

parent df6be57e
Pipeline #103 failed with stage
in 0 seconds
......@@ -211,6 +211,10 @@ BELLESIP_EXPORT int belle_sip_object_get_object_count(void);
BELLESIP_EXPORT void belle_sip_object_flush_active_objects(void);
BELLESIP_EXPORT void belle_sip_object_dump_active_objects(void);
/*
* Might be used to explicitly remove an object from leak detector.
*/
BELLESIP_EXPORT void belle_sip_object_remove_from_leak_detector(belle_sip_object_t *obj);
/**
* Suspend leak detector from this point. If the leak detector wasn't activated, this function does nothing.
......
......@@ -51,7 +51,7 @@ static void add_new_object(belle_sip_object_t *obj){
}
}
static void remove_free_object(belle_sip_object_t *obj){
void belle_sip_object_remove_from_leak_detector(belle_sip_object_t *obj){
if (belle_sip_leak_detector_enabled && !belle_sip_leak_detector_inhibited){
belle_sip_list_t* it;
it=belle_sip_list_find(all_objects,obj);
......@@ -244,7 +244,7 @@ void belle_sip_object_delete(void *ptr){
belle_sip_object_vptr_t *vptr;
belle_sip_object_loose_weak_refs(obj);
remove_free_object(obj);
belle_sip_object_remove_from_leak_detector(obj);
vptr=obj->vptr;
while(vptr!=NULL){
if (vptr->destroy) vptr->destroy(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