From 6fba48cd158489aa83ef92632bc14d3a5bc27fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 3 Oct 2016 23:45:02 +0200 Subject: [PATCH] MemoryView: Don't segfault if Core isn't running There was a bug that caused MemoryView to indirectly cause a segfault; the simplest way to reproduce it is 1) start a game; 2) stop the game; 3) click on the Refresh button and watch Dolphin segfault. This commit fixes it by only calling PowerPC::HostIsRAMAddress when emulation is running. --- Source/Core/DolphinWX/Debugger/MemoryView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp index 1bd64c8d9c..f5bebea901 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp @@ -312,11 +312,11 @@ void CMemoryView::OnPaint(wxPaintEvent& event) dc.SetTextForeground(*wxBLACK); } - if (!PowerPC::HostIsRAMAddress(address)) - continue; - if (debugger->IsAlive()) { + if (!PowerPC::HostIsRAMAddress(address)) + continue; + std::string dis; u32 mem_data = debugger->ReadExtraMemory(memory, address);