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/RegisterView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/RegisterView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/RegisterView.cpp b/Source/Core/DolphinWX/Debugger/RegisterView.cpp index ca7cdc70ec..f7a268cad0 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterView.cpp +++ b/Source/Core/DolphinWX/Debugger/RegisterView.cpp @@ -274,10 +274,10 @@ void CRegisterView::OnMouseDownR(wxGridEvent& event) wxString strNewVal = GetValueByRowCol(row, col); TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress); - wxMenu* menu = new wxMenu; - menu->Append(IDM_WATCHADDRESS, _("Add to &watch")); - menu->Append(IDM_VIEWMEMORY, _("View &memory")); - PopupMenu(menu); + wxMenu menu; + menu.Append(IDM_WATCHADDRESS, _("Add to &watch")); + menu.Append(IDM_VIEWMEMORY, _("View &memory")); + PopupMenu(&menu); } void CRegisterView::OnPopupMenu(wxCommandEvent& event) -- cgit v1.2.3