1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Attempt to fix / trace crashes from Google Play statistics

This commit is contained in:
Ivan Savenko
2023-07-17 22:19:25 +03:00
parent c7d88271a9
commit 5e8a778e7d
4 changed files with 31 additions and 8 deletions

View File

@@ -163,6 +163,7 @@ BattleInterface::~BattleInterface()
if (adventureInt)
adventureInt->onAudioResumed();
awaitingEvents.clear();
onAnimationsFinished();
}
@@ -781,8 +782,19 @@ void BattleInterface::onAnimationsFinished()
void BattleInterface::waitForAnimations()
{
auto unlockPim = vstd::makeUnlockGuard(*CPlayerInterface::pim);
ongoingAnimationsState.waitUntil(false);
{
auto unlockPim = vstd::makeUnlockGuard(*CPlayerInterface::pim);
ongoingAnimationsState.waitUntil(false);
}
assert(!hasAnimations());
assert(awaitingEvents.empty());
if (!awaitingEvents.empty())
{
logGlobal->error("Wait for animations finished but we still have awaiting events!");
awaitingEvents.clear();
}
}
bool BattleInterface::hasAnimations()