From 56d0c5103301a2e5c8776f0a04e911f2507b3377 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Thu, 1 Dec 2016 18:25:14 +0000 Subject: [PATCH] pcsx2:windows: Don't create console stdio menu item It's not used on Windows and it causes Visual Studio to report a memory issue. --- pcsx2/gui/MainFrame.cpp | 7 +++++++ pcsx2/gui/MainFrame.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 6eb4ec9be1..6cada54c8e 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -232,7 +232,9 @@ void MainEmuFrame::ConnectMenus() // Misc Bind(wxEVT_MENU, &MainEmuFrame::Menu_ShowConsole, this, MenuId_Console); +#if defined(__unix__) Bind(wxEVT_MENU, &MainEmuFrame::Menu_ShowConsole_Stdio, this, MenuId_Console_Stdio); +#endif Bind(wxEVT_MENU, &MainEmuFrame::Menu_ShowAboutBox, this, MenuId_About); Bind(wxEVT_MENU, &MainEmuFrame::Menu_ChangeLang, this, MenuId_ChangeLang); @@ -324,7 +326,9 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) , m_SaveStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Save01 ) ) , m_MenuItem_Console( *new wxMenuItem( &m_menuMisc, MenuId_Console, _("&Show Console"), wxEmptyString, wxITEM_CHECK ) ) +#if defined(__unix__) , m_MenuItem_Console_Stdio( *new wxMenuItem( &m_menuMisc, MenuId_Console_Stdio, _("&Console to Stdio"), wxEmptyString, wxITEM_CHECK ) ) +#endif { m_RestartEmuOnDelete = false; @@ -452,6 +456,9 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) wxMenu& isoRecents( wxGetApp().GetRecentIsoMenu() ); //m_menuCDVD.AppendSeparator(); + // FIXME: VS2015 thinks there's a memory issue here and there probably is one. + // The submenu is owned by a unique_ptr, but any menu that is attached to a + // menubar or another menu will be deleted by its parent. m_menuCDVD.Append( MenuId_IsoSelector, _("Iso &Selector"), &isoRecents ); m_menuCDVD.Append( GetPluginMenuId_Settings(PluginId_CDVD), _("Plugin &Menu"), m_PluginMenuPacks[PluginId_CDVD] ); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index 17010d607b..2ab6b3b045 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -116,7 +116,9 @@ protected: wxMenu& m_SaveStatesSubmenu; wxMenuItem& m_MenuItem_Console; +#if defined(__unix__) wxMenuItem& m_MenuItem_Console_Stdio; +#endif PerPluginMenuInfo m_PluginMenuPacks[PluginId_Count];