mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-23 12:08:45 +02:00
Attempt to fix crash on quitApplication on Android
This commit is contained in:
parent
ef0cd0ba6e
commit
00ac8eb306
@ -77,7 +77,6 @@
|
|||||||
#define COMPLAIN_RETF(txt, FORMAT) {complain(boost::str(boost::format(txt) % FORMAT)); return false;}
|
#define COMPLAIN_RETF(txt, FORMAT) {complain(boost::str(boost::format(txt) % FORMAT)); return false;}
|
||||||
|
|
||||||
CondSh<bool> battleMadeAction(false);
|
CondSh<bool> battleMadeAction(false);
|
||||||
boost::recursive_mutex battleActionMutex;
|
|
||||||
CondSh<BattleResult *> battleResult(nullptr);
|
CondSh<BattleResult *> battleResult(nullptr);
|
||||||
template <typename T> class CApplyOnGH;
|
template <typename T> class CApplyOnGH;
|
||||||
|
|
||||||
|
@ -102,6 +102,8 @@ class CGameHandler : public IGameCallback, public CBattleInfoCallback, public En
|
|||||||
std::unique_ptr<boost::thread> battleThread;
|
std::unique_ptr<boost::thread> battleThread;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
boost::recursive_mutex battleActionMutex;
|
||||||
|
|
||||||
std::unique_ptr<HeroPoolProcessor> heroPool;
|
std::unique_ptr<HeroPoolProcessor> heroPool;
|
||||||
|
|
||||||
using FireShieldInfo = std::vector<std::pair<const CStack *, int64_t>>;
|
using FireShieldInfo = std::vector<std::pair<const CStack *, int64_t>>;
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
#include "../lib/spells/ISpellMechanics.h"
|
#include "../lib/spells/ISpellMechanics.h"
|
||||||
#include "../lib/serializer/Cast.h"
|
#include "../lib/serializer/Cast.h"
|
||||||
|
|
||||||
extern boost::recursive_mutex battleActionMutex;
|
|
||||||
|
|
||||||
void ApplyGhNetPackVisitor::visitSaveGame(SaveGame & pack)
|
void ApplyGhNetPackVisitor::visitSaveGame(SaveGame & pack)
|
||||||
{
|
{
|
||||||
gh.save(pack.fname);
|
gh.save(pack.fname);
|
||||||
@ -282,7 +280,7 @@ void ApplyGhNetPackVisitor::visitQueryReply(QueryReply & pack)
|
|||||||
|
|
||||||
void ApplyGhNetPackVisitor::visitMakeAction(MakeAction & pack)
|
void ApplyGhNetPackVisitor::visitMakeAction(MakeAction & pack)
|
||||||
{
|
{
|
||||||
boost::unique_lock lock(battleActionMutex);
|
boost::unique_lock lock(gh.battleActionMutex);
|
||||||
|
|
||||||
const BattleInfo * b = gs.curB;
|
const BattleInfo * b = gs.curB;
|
||||||
if(!b)
|
if(!b)
|
||||||
@ -311,7 +309,7 @@ void ApplyGhNetPackVisitor::visitMakeAction(MakeAction & pack)
|
|||||||
|
|
||||||
void ApplyGhNetPackVisitor::visitMakeCustomAction(MakeCustomAction & pack)
|
void ApplyGhNetPackVisitor::visitMakeCustomAction(MakeCustomAction & pack)
|
||||||
{
|
{
|
||||||
boost::unique_lock lock(battleActionMutex);
|
boost::unique_lock lock(gh.battleActionMutex);
|
||||||
|
|
||||||
const BattleInfo * b = gs.curB;
|
const BattleInfo * b = gs.curB;
|
||||||
if(!b)
|
if(!b)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user