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