Make sure we don't dereference a channel whose disconnect() was called from destroyed().

git-svn-id: http://yate.null.ro/svn/yate/trunk@5966 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2015-04-07 14:07:14 +00:00
parent 4087d69c8f
commit 23213233c2
1 changed files with 4 additions and 1 deletions

View File

@ -191,11 +191,14 @@ bool CallEndpoint::disconnect(bool final, const char* reason, bool notify, const
}
temp->setPeer(0,reason,notify,params);
bool dead = !alive();
if (dead)
Debug(DebugMild,"CallEndpoint '%s' disconnect called while dead [%p]",m_id.c_str(),this);
if (final)
disconnected(true,reason);
lock.drop();
temp->deref();
return deref();
return dead || deref();
}
void CallEndpoint::setPeer(CallEndpoint* peer, const char* reason, bool notify, const NamedList* params)