mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Fix another case of assertion failure on exit
This commit is contained in:
parent
39367473d2
commit
8665f36778
@ -1508,9 +1508,7 @@ static void mainLoop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleQuit(bool ask)
|
static void quitApplication()
|
||||||
{
|
|
||||||
auto quitApplication = []()
|
|
||||||
{
|
{
|
||||||
if(!settings["session"]["headless"].Bool())
|
if(!settings["session"]["headless"].Bool())
|
||||||
{
|
{
|
||||||
@ -1574,22 +1572,25 @@ void handleQuit(bool ask)
|
|||||||
logConfig = nullptr;
|
logConfig = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::cout << "Ending...\n";
|
std::cout << "Ending...\n";
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleQuit(bool ask)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(CSH->client && LOCPLINT && ask)
|
||||||
|
{
|
||||||
|
CCS->curh->changeGraphic(ECursor::ADVENTURE, 0);
|
||||||
|
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[69], [](){
|
||||||
// Workaround for assertion failure on exit:
|
// Workaround for assertion failure on exit:
|
||||||
// handleQuit() is alway called during SDL event processing
|
// handleQuit() is alway called during SDL event processing
|
||||||
// during which, eventsM is kept locked
|
// during which, eventsM is kept locked
|
||||||
// this leads to assertion failure if boost::mutex is in locked state
|
// this leads to assertion failure if boost::mutex is in locked state
|
||||||
eventsM.unlock();
|
eventsM.unlock();
|
||||||
|
|
||||||
exit(0);
|
quitApplication();
|
||||||
};
|
}, nullptr);
|
||||||
|
|
||||||
if(CSH->client && LOCPLINT && ask)
|
|
||||||
{
|
|
||||||
CCS->curh->changeGraphic(ECursor::ADVENTURE, 0);
|
|
||||||
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[69], quitApplication, nullptr);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user