From 892bbdade669def297b0469509dd648fef6478bd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 11 Nov 2014 09:50:11 -0500 Subject: DolphinWX: Eliminate some memory leaks Since the menus aren't actually assigned a parent, they would not be freed by wx. Plus, these should have initially been constructed on the stack in the first place. Technically any time someone right-clicked the game list they would be leaking memory. --- Source/Core/DolphinWX/Debugger/MemoryView.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/MemoryView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp index d690f1f56d..86b0215f2a 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp @@ -221,22 +221,22 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event) void CMemoryView::OnMouseDownR(wxMouseEvent& event) { // popup menu - wxMenu* menu = new wxMenu; + wxMenu menu; //menu.Append(IDM_GOTOINMEMVIEW, _("&Goto in mem view")); #if wxUSE_CLIPBOARD - menu->Append(IDM_COPYADDRESS, _("Copy &address")); - menu->Append(IDM_COPYHEX, _("Copy &hex")); + menu.Append(IDM_COPYADDRESS, _("Copy &address")); + menu.Append(IDM_COPYHEX, _("Copy &hex")); #endif - menu->Append(IDM_WATCHADDRESS, _("Add to &watch")); - menu->Append(IDM_TOGGLEMEMORY, _("Toggle &memory")); + menu.Append(IDM_WATCHADDRESS, _("Add to &watch")); + menu.Append(IDM_TOGGLEMEMORY, _("Toggle &memory")); - wxMenu* viewAsSubMenu = new wxMenu; - viewAsSubMenu->Append(IDM_VIEWASFP, _("FP value")); - viewAsSubMenu->Append(IDM_VIEWASASCII, "ASCII"); - viewAsSubMenu->Append(IDM_VIEWASHEX, _("Hex")); - menu->AppendSubMenu(viewAsSubMenu, _("View As:")); + wxMenu viewAsSubMenu; + viewAsSubMenu.Append(IDM_VIEWASFP, _("FP value")); + viewAsSubMenu.Append(IDM_VIEWASASCII, "ASCII"); + viewAsSubMenu.Append(IDM_VIEWASHEX, _("Hex")); + menu.AppendSubMenu(&viewAsSubMenu, _("View As:")); - PopupMenu(menu); + PopupMenu(&menu); } void CMemoryView::OnPaint(wxPaintEvent& event) -- cgit v1.2.3