mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Fixed CID 1288850
This commit is contained in:
parent
30663f15ea
commit
8b4f1fc938
@ -2933,6 +2933,7 @@ void InfoAboutArmy::initFromArmy(const CArmedInstance *Army, bool detailed)
|
||||
|
||||
void InfoAboutHero::assign(const InfoAboutHero & iah)
|
||||
{
|
||||
vstd::clear_pointer(details);
|
||||
InfoAboutArmy::operator = (iah);
|
||||
|
||||
details = (iah.details ? new Details(*iah.details) : nullptr);
|
||||
@ -2962,7 +2963,7 @@ InfoAboutHero::InfoAboutHero(const CGHeroInstance *h, InfoAboutHero::EInfoLevel
|
||||
|
||||
InfoAboutHero::~InfoAboutHero()
|
||||
{
|
||||
delete details;
|
||||
vstd::clear_pointer(details);
|
||||
}
|
||||
|
||||
InfoAboutHero & InfoAboutHero::operator=(const InfoAboutHero & iah)
|
||||
@ -2973,6 +2974,7 @@ InfoAboutHero & InfoAboutHero::operator=(const InfoAboutHero & iah)
|
||||
|
||||
void InfoAboutHero::initFromHero(const CGHeroInstance *h, InfoAboutHero::EInfoLevel infoLevel)
|
||||
{
|
||||
vstd::clear_pointer(details);
|
||||
if(!h)
|
||||
return;
|
||||
|
||||
@ -3013,14 +3015,18 @@ InfoAboutTown::InfoAboutTown():
|
||||
|
||||
}
|
||||
|
||||
InfoAboutTown::InfoAboutTown(const CGTownInstance *t, bool detailed)
|
||||
InfoAboutTown::InfoAboutTown(const CGTownInstance *t, bool detailed):
|
||||
details(nullptr),
|
||||
tType(nullptr),
|
||||
built(0),
|
||||
fortLevel(0)
|
||||
{
|
||||
initFromTown(t, detailed);
|
||||
}
|
||||
|
||||
InfoAboutTown::~InfoAboutTown()
|
||||
{
|
||||
delete details;
|
||||
vstd::clear_pointer(details);
|
||||
}
|
||||
|
||||
void InfoAboutTown::initFromTown(const CGTownInstance *t, bool detailed)
|
||||
@ -3032,6 +3038,8 @@ void InfoAboutTown::initFromTown(const CGTownInstance *t, bool detailed)
|
||||
name = t->name;
|
||||
tType = t->town;
|
||||
|
||||
vstd::clear_pointer(details);
|
||||
|
||||
if(detailed)
|
||||
{
|
||||
//include details about hero
|
||||
|
Loading…
x
Reference in New Issue
Block a user