Commit 1f5fe769 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Also remove the link fromn dead objects toward their children

Previously, we only removed links from children to dead parents.
This patch is semantically the same as Funman's earlier
vlc_object_detach_unlocked() patch. It is merely faster and less clean.

Unfortunately, this means it is impossible to detect leaked children.
That being noted, leaving dead parents "semi-attached" in objects tree
is not thread-safe anyhow. Basically, we either automatically detach
objects (and miss leaks), or require children to be detached/destroyed
before their parent is destroyed (and get leaks detection, but more
coding pain).
parent d88c9875
......@@ -889,7 +889,12 @@ void __vlc_object_release( vlc_object_t *p_this )
vlc_mutex_unlock( &structure_lock );
if( b_should_destroy )
{
free( internals->pp_children );
internals->pp_children = NULL;
internals->i_children = 0;
vlc_object_destroy( p_this );
}
}
/**
......
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