Fixed memory leak when closing down windows.

master
sigonasr2 1 year ago
parent cb4a564c48
commit b4b4d59a88
  1. 1
      FiestaOnlineEditor/FiestaOnlineEditor.cpp
  2. 2
      FiestaOnlineEditor/ItemEditor.cpp
  3. 1
      FiestaOnlineEditor/ItemEditor.h
  4. 2
      FiestaOnlineEditor/Window.cpp
  5. 1
      FiestaOnlineEditor/Window.h

@ -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…
Cancel
Save