Prevent withering of the provider we're orphaning from happening until
we do it ourselves. Nailed by: Simon Heath <heath@cng.fr>
This commit is contained in:
parent
11aa947d12
commit
fe692735bf
@ -126,10 +126,14 @@ static void
|
||||
g_orphan_register(struct g_provider *pp)
|
||||
{
|
||||
struct g_consumer *cp, *cp2;
|
||||
int wf;
|
||||
|
||||
g_trace(G_T_TOPOLOGY, "g_orphan_register(%s)", pp->name);
|
||||
g_topology_assert();
|
||||
|
||||
wf = pp->flags & G_PF_WITHER;
|
||||
pp->flags &= ~G_PF_WITHER;
|
||||
|
||||
/*
|
||||
* Tell all consumers the bad news.
|
||||
* Don't be surprised if they self-destruct.
|
||||
@ -143,8 +147,10 @@ g_orphan_register(struct g_provider *pp)
|
||||
cp->geom->orphan(cp);
|
||||
cp = cp2;
|
||||
}
|
||||
if (LIST_EMPTY(&pp->consumers) && (pp->flags & G_PF_WITHER))
|
||||
if (LIST_EMPTY(&pp->consumers) && wf)
|
||||
g_destroy_provider(pp);
|
||||
else
|
||||
pp->flags |= wf;
|
||||
#ifdef notyet
|
||||
cp = LIST_FIRST(&pp->consumers);
|
||||
if (cp != NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user