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

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