1
0
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:
Michał W. Urbańczyk 2008-01-27 14:07:51 +00:00
parent 19c1fee418
commit 9b805ea1e7
2 changed files with 5 additions and 0 deletions

View File

@ -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]);

View File

@ -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;