gui: add a destructor to CtrlRegisterList object

So we can free allocated memory
This commit is contained in:
Gregory Hainaut 2016-07-19 18:54:56 +02:00
parent 11e5fe8879
commit 8b91aefd49
2 changed files with 10 additions and 2 deletions

View File

@ -80,6 +80,13 @@ CtrlRegisterList::CtrlRegisterList(wxWindow* parent, DebugInterface* _cpu)
SetScrollbars(1, rowHeight, actualSize.x, actualSize.y / rowHeight, 0, 0); SetScrollbars(1, rowHeight, actualSize.x, actualSize.y / rowHeight, 0, 0);
} }
CtrlRegisterList::~CtrlRegisterList()
{
for (auto& regs : changedCategories)
delete[] regs;
}
wxSize CtrlRegisterList::getOptimalSize() const wxSize CtrlRegisterList::getOptimalSize() const
{ {
int columnChars = 0; int columnChars = 0;

View File

@ -23,14 +23,15 @@ class CtrlRegisterList: public wxScrolledWindow
{ {
public: public:
CtrlRegisterList(wxWindow* parent, DebugInterface* _cpu); CtrlRegisterList(wxWindow* parent, DebugInterface* _cpu);
~CtrlRegisterList();
void mouseEvent(wxMouseEvent& evt); void mouseEvent(wxMouseEvent& evt);
void keydownEvent(wxKeyEvent& evt); void keydownEvent(wxKeyEvent& evt);
void onPopupClick(wxCommandEvent& evt); void onPopupClick(wxCommandEvent& evt);
void sizeEvent(wxSizeEvent& evt); void sizeEvent(wxSizeEvent& evt);
void redraw(); void redraw();
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
virtual wxSize GetMinClientSize() const virtual wxSize GetMinClientSize() const
{ {
wxSize optimalSize = getOptimalSize(); wxSize optimalSize = getOptimalSize();