From 4d3f05ddf85ff82398b47cdca40189c3f0ef0453 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sat, 28 Nov 2015 22:38:53 +0100 Subject: [PATCH] DebuggerViews: Fixed nullptr dereferences --- Source/Core/DolphinWX/Debugger/MemoryView.cpp | 2 +- Source/Core/DolphinWX/Debugger/RegisterView.cpp | 2 +- Source/Core/DolphinWX/Debugger/WatchView.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp index 812c1a8eda..0fcd5a069f 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp @@ -156,7 +156,7 @@ void CMemoryView::OnScrollWheel(wxMouseEvent& event) void CMemoryView::OnPopupMenu(wxCommandEvent& event) { - CFrame* main_frame = (CFrame*)(GetParent()->GetParent()->GetParent()); + CFrame* main_frame = static_cast(GetGrandParent()->GetParent()); CCodeWindow* code_window = main_frame->g_pCodeWindow; CWatchWindow* watch_window = code_window->m_WatchWindow; diff --git a/Source/Core/DolphinWX/Debugger/RegisterView.cpp b/Source/Core/DolphinWX/Debugger/RegisterView.cpp index 9f29b032ba..232e7774ef 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterView.cpp +++ b/Source/Core/DolphinWX/Debugger/RegisterView.cpp @@ -273,7 +273,7 @@ void CRegisterView::OnMouseDownR(wxGridEvent& event) void CRegisterView::OnPopupMenu(wxCommandEvent& event) { - CFrame* main_frame = (CFrame*)(GetParent()->GetParent()); + CFrame* main_frame = static_cast(GetGrandParent()->GetParent()); CCodeWindow* code_window = main_frame->g_pCodeWindow; CWatchWindow* watch_window = code_window->m_WatchWindow; CMemoryWindow* memory_window = code_window->m_MemoryWindow; diff --git a/Source/Core/DolphinWX/Debugger/WatchView.cpp b/Source/Core/DolphinWX/Debugger/WatchView.cpp index be5c5dad64..ea79573f12 100644 --- a/Source/Core/DolphinWX/Debugger/WatchView.cpp +++ b/Source/Core/DolphinWX/Debugger/WatchView.cpp @@ -261,7 +261,7 @@ void CWatchView::OnMouseDownR(wxGridEvent& event) void CWatchView::OnPopupMenu(wxCommandEvent& event) { - CFrame* main_frame = (CFrame*)(GetParent()->GetParent()); + CFrame* main_frame = static_cast(GetGrandParent()->GetParent()); CCodeWindow* code_window = main_frame->g_pCodeWindow; CWatchWindow* watch_window = code_window->m_WatchWindow; CMemoryWindow* memory_window = code_window->m_MemoryWindow;