summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Debugger/CodeView.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-07-17 04:49:45 -0400
committerLioncash <mathew1800@gmail.com>2014-07-17 04:50:53 -0400
commitbc172f488320a41b8a5bbf216a589ddac4215f06 (patch)
treef1e627be45e63c3627cda1ca5ca912e713028f3f /Source/Core/DolphinWX/Debugger/CodeView.cpp
parentae65b3ba2c2ced70b3a04b392ebbd7ad2ccb0784 (diff)
DolphinWX: Enable certain Code View context options only when the core is running.
Prior to this, attempting to execute these contextual menu options would crash the application.
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp')
-rw-r--r--Source/Core/DolphinWX/Debugger/CodeView.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp
index 582ff88042..9d7b869518 100644
--- a/Source/Core/DolphinWX/Debugger/CodeView.cpp
+++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp
@@ -30,6 +30,7 @@
#include "Common/DebugInterface.h"
#include "Common/StringUtil.h"
#include "Common/SymbolDB.h"
+#include "Core/Core.h"
#include "Core/Host.h"
#include "DolphinWX/WxUtils.h"
#include "DolphinWX/Debugger/CodeView.h"
@@ -370,12 +371,12 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event)
#endif
menu->Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol);
menu->AppendSeparator();
- menu->Append(IDM_RUNTOHERE, _("&Run To Here"));
- menu->Append(IDM_ADDFUNCTION, _("&Add function"));
- menu->Append(IDM_JITRESULTS, _("PPC vs X86"));
- menu->Append(IDM_INSERTBLR, _("Insert &blr"));
- menu->Append(IDM_INSERTNOP, _("Insert &nop"));
- menu->Append(IDM_PATCHALERT, _("Patch alert"));
+ menu->Append(IDM_RUNTOHERE, _("&Run To Here"))->Enable(Core::IsRunning());
+ menu->Append(IDM_ADDFUNCTION, _("&Add function"))->Enable(Core::IsRunning());
+ menu->Append(IDM_JITRESULTS, _("PPC vs X86"))->Enable(Core::IsRunning());
+ menu->Append(IDM_INSERTBLR, _("Insert &blr"))->Enable(Core::IsRunning());
+ menu->Append(IDM_INSERTNOP, _("Insert &nop"))->Enable(Core::IsRunning());
+ menu->Append(IDM_PATCHALERT, _("Patch alert"))->Enable(Core::IsRunning());
PopupMenu(menu);
event.Skip();
}