8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 07:23:04 +01:00

Fixed AV on client : when disconnect happens while event callback run

This commit is contained in:
hvlad 2015-10-22 13:40:43 +00:00
parent 22daf59b41
commit 682baeba6f

View File

@ -3872,9 +3872,15 @@ FB_API_HANDLE& YEvents::getHandle()
void YEvents::destroy(unsigned dstrFlags)
{
attachment->childEvents.remove(this);
removeHandle(&events, handle);
if (!(dstrFlags & DF_RELEASE))
{
const bool allowCancel = destroyed.compareExchange(0, 1);
if (!allowCancel)
return;
}
destroy2(dstrFlags);
}