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.
This commit is contained in:
Lioncash
2014-11-11 09:50:11 -05:00
parent 71d8165a86
commit 892bbdade6
8 changed files with 104 additions and 104 deletions

View File

@ -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)