mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Added workaround for potential access to CIntObject after destruction
This commit is contained in:
parent
c99d4b959e
commit
cbd5f57069
@ -213,12 +213,21 @@ void EventDispatcher::handleLeftButtonClick(const Point & position, int toleranc
|
||||
if( i->receiveEvent(position, AEventsReceiver::LCLICK) || i == nearestElement)
|
||||
{
|
||||
if(isPressed)
|
||||
{
|
||||
i->mouseClickedState = isPressed;
|
||||
i->clickPressed(position, lastActivated);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i->mouseClickedState)
|
||||
{
|
||||
i->mouseClickedState = isPressed;
|
||||
i->clickReleased(position, lastActivated);
|
||||
}
|
||||
else
|
||||
i->mouseClickedState = isPressed;
|
||||
}
|
||||
|
||||
if (i->mouseClickedState && !isPressed)
|
||||
i->clickReleased(position, lastActivated);
|
||||
|
||||
i->mouseClickedState = isPressed;
|
||||
lastActivated = false;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user