From 5ada887f94b5a571446c65bd4f1e9298dd8e2fea Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Mar 2015 09:37:20 -0400 Subject: DolphinWX: Get rid of wxGrid-based casts in the debugger. This technically also fixes a memory leak in WatchView.cpp, because the table setting was done such that the grid wouldn't take ownership of the table, which means said table wouldn't be deleted in the grid's destructor. --- Source/Core/DolphinWX/Debugger/DSPRegisterView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPRegisterView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPRegisterView.cpp b/Source/Core/DolphinWX/Debugger/DSPRegisterView.cpp index e62bfcb781..0eece2d15c 100644 --- a/Source/Core/DolphinWX/Debugger/DSPRegisterView.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPRegisterView.cpp @@ -77,7 +77,9 @@ wxGridCellAttr *CDSPRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKi DSPRegisterView::DSPRegisterView(wxWindow *parent, wxWindowID id) : wxGrid(parent, id, wxDefaultPosition, wxSize(130, 120)) { - SetTable(new CDSPRegTable(), true); + m_register_table = new CDSPRegTable(); + + SetTable(m_register_table, true); SetRowLabelSize(0); SetColLabelSize(0); DisableDragRowSize(); @@ -87,6 +89,6 @@ DSPRegisterView::DSPRegisterView(wxWindow *parent, wxWindowID id) void DSPRegisterView::Update() { - ((CDSPRegTable *)GetTable())->UpdateCachedRegs(); + m_register_table->UpdateCachedRegs(); ForceRefresh(); } -- cgit v1.2.3