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/WatchView.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/WatchView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/WatchView.cpp b/Source/Core/DolphinWX/Debugger/WatchView.cpp index 8bf1d0b14b..d5d6913a66 100644 --- a/Source/Core/DolphinWX/Debugger/WatchView.cpp +++ b/Source/Core/DolphinWX/Debugger/WatchView.cpp @@ -247,18 +247,18 @@ void CWatchView::OnMouseDownR(wxGridEvent& event) TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress); } - wxMenu* menu = new wxMenu; + wxMenu menu; if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1)) - menu->Append(IDM_DELETEWATCH, _("&Delete watch")); + menu.Append(IDM_DELETEWATCH, _("&Delete watch")); if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1) && (col == 1 || col == 2)) { #ifdef ENABLE_MEM_CHECK - menu->Append(IDM_ADDMEMCHECK, _("Add memory &breakpoint")); + menu.Append(IDM_ADDMEMCHECK, _("Add memory &breakpoint")); #endif - menu->Append(IDM_VIEWMEMORY, _("View &memory")); + menu.Append(IDM_VIEWMEMORY, _("View &memory")); } - PopupMenu(menu); + PopupMenu(&menu); } void CWatchView::OnPopupMenu(wxCommandEvent& event) -- cgit v1.2.3