summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameAui.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-11-11 09:50:11 -0500
committerLioncash <mathew1800@gmail.com>2014-11-11 09:50:16 -0500
commit892bbdade669def297b0469509dd648fef6478bd (patch)
tree7398436a807d1f1f19c45e30c3722ef58abedd0e /Source/Core/DolphinWX/FrameAui.cpp
parent71d8165a8649cde73663b1534bbdd6094faecf2d (diff)
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.
Diffstat (limited to 'Source/Core/DolphinWX/FrameAui.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameAui.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/Core/DolphinWX/FrameAui.cpp b/Source/Core/DolphinWX/FrameAui.cpp
index 43e3f86043..cfabde869d 100644
--- a/Source/Core/DolphinWX/FrameAui.cpp
+++ b/Source/Core/DolphinWX/FrameAui.cpp
@@ -333,21 +333,21 @@ void CFrame::OnTab(wxAuiNotebookEvent& event)
if (!g_pCodeWindow) return;
// Create the popup menu
- wxMenu* MenuPopup = new wxMenu;
+ wxMenu MenuPopup;
- wxMenuItem* Item = new wxMenuItem(MenuPopup, wxID_ANY, _("Select floating windows"));
- MenuPopup->Append(Item);
+ wxMenuItem* Item = new wxMenuItem(&MenuPopup, wxID_ANY, _("Select floating windows"));
+ MenuPopup.Append(Item);
Item->Enable(false);
- MenuPopup->Append(new wxMenuItem(MenuPopup));
+ MenuPopup.Append(new wxMenuItem(&MenuPopup));
for (int i = IDM_LOGWINDOW; i <= IDM_CODEWINDOW; i++)
{
wxWindow *Win = FindWindowById(i);
if (Win && Win->IsEnabled())
{
- Item = new wxMenuItem(MenuPopup, i + IDM_FLOAT_LOGWINDOW - IDM_LOGWINDOW,
+ Item = new wxMenuItem(&MenuPopup, i + IDM_FLOAT_LOGWINDOW - IDM_LOGWINDOW,
Win->GetName(), "", wxITEM_CHECK);
- MenuPopup->Append(Item);
+ MenuPopup.Append(Item);
Item->Check(!!FindWindowById(i + IDM_LOGWINDOW_PARENT - IDM_LOGWINDOW));
}
}
@@ -357,7 +357,7 @@ void CFrame::OnTab(wxAuiNotebookEvent& event)
Pt = ScreenToClient(Pt);
// Show
- PopupMenu(MenuPopup, Pt);
+ PopupMenu(&MenuPopup, Pt);
}
void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event)