Fixed memory leak when closing down windows.
This commit is contained in:
parent
cb4a564c48
commit
b4b4d59a88
@ -186,6 +186,7 @@ bool FiestaOnlineEditor::OnUserUpdate(float fElapsedTime){
|
||||
focusErased=true;
|
||||
}
|
||||
w->Cleanup();
|
||||
delete w;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -3,6 +3,8 @@
|
||||
ItemEditor::ItemEditor(FiestaOnlineEditor*pge,std::string windowTitle,vi2d pos,vi2d size)
|
||||
:Window(pge,windowTitle,pos,size){}
|
||||
|
||||
ItemEditor::~ItemEditor(){};
|
||||
|
||||
void ItemEditor::Load(std::string basePath){
|
||||
ItemInfo.Load(basePath+"/ItemInfo.shn");
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ class ItemEditor:public Window{
|
||||
vf2d pos={64,64};
|
||||
public:
|
||||
ItemEditor(FiestaOnlineEditor*pge,std::string windowTitle,vi2d pos,vi2d size);
|
||||
~ItemEditor();
|
||||
void Load(std::string basePath);
|
||||
void Refresh(FiestaOnlineEditor*pge)override;
|
||||
void Update(FiestaOnlineEditor*pge,float fElapsedTime)override;
|
||||
|
@ -10,6 +10,8 @@ Window::Window(FiestaOnlineEditor*pge,std::string windowTitle,vi2d pos,vi2d size
|
||||
//InternalRefresh(pge);
|
||||
}
|
||||
|
||||
Window::~Window(){};
|
||||
|
||||
void Window::InternalUpdate(FiestaOnlineEditor*pge,float fElapsedTime){
|
||||
if(this==focusedWindow){
|
||||
Update(pge,fElapsedTime);
|
||||
|
@ -19,6 +19,7 @@ protected:
|
||||
std::string windowTitle="";
|
||||
public:
|
||||
Window(FiestaOnlineEditor*pge,std::string windowTitle,vi2d pos,vi2d size);
|
||||
virtual ~Window();
|
||||
void InternalUpdate(FiestaOnlineEditor*pge,float fElapsedTime);
|
||||
virtual void Update(FiestaOnlineEditor*pge,float fElapsedTime)=0;
|
||||
virtual void Refresh(FiestaOnlineEditor*pge)=0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user