mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Fixed crashbug in infoWindows.
This commit is contained in:
@@ -281,6 +281,7 @@ CInfoWindow::CInfoWindow()
|
|||||||
{
|
{
|
||||||
okb.ourObj = this;
|
okb.ourObj = this;
|
||||||
okb.delg = this;
|
okb.delg = this;
|
||||||
|
okb.notFreeButton=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoWindow::okClicked(tribool down)
|
void CInfoWindow::okClicked(tribool down)
|
||||||
@@ -561,11 +562,14 @@ CButtonBase::CButtonBase()
|
|||||||
type=-1;
|
type=-1;
|
||||||
abs=false;
|
abs=false;
|
||||||
active=false;
|
active=false;
|
||||||
|
notFreeButton = false;
|
||||||
ourObj=NULL;
|
ourObj=NULL;
|
||||||
state=0;
|
state=0;
|
||||||
}
|
}
|
||||||
CButtonBase::~CButtonBase()
|
CButtonBase::~CButtonBase()
|
||||||
{
|
{
|
||||||
|
if(notFreeButton)
|
||||||
|
return;
|
||||||
for(int i =0; i<imgs.size();i++)
|
for(int i =0; i<imgs.size();i++)
|
||||||
for(int j=0;j<imgs[i].size();j++)
|
for(int j=0;j<imgs[i].size();j++)
|
||||||
SDL_FreeSurface(imgs[i][j]);
|
SDL_FreeSurface(imgs[i][j]);
|
||||||
|
@@ -47,6 +47,7 @@ public:
|
|||||||
int type; //advmapbutton=2
|
int type; //advmapbutton=2
|
||||||
bool abs;
|
bool abs;
|
||||||
bool active;
|
bool active;
|
||||||
|
bool notFreeButton;
|
||||||
CIntObject * ourObj; // "owner"
|
CIntObject * ourObj; // "owner"
|
||||||
int state;
|
int state;
|
||||||
std::vector< std::vector<SDL_Surface*> > imgs;
|
std::vector< std::vector<SDL_Surface*> > imgs;
|
||||||
|
Reference in New Issue
Block a user