Fix a segmentation fault when the wiimote source is changed to a real wiimote in the config dialog.

A little clean up of the debugger code.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7237 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-02-25 03:56:14 +00:00
parent 18b85b9cd5
commit 1f33fc1a48
6 changed files with 8 additions and 32 deletions

View File

@ -143,11 +143,6 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
InitBitmaps(); InitBitmaps();
CreateGUIControls(_LocalCoreStartupParameter); CreateGUIControls(_LocalCoreStartupParameter);
// Connect keyboard
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN,
wxKeyEventHandler(CCodeWindow::OnKeyDown),
(wxObject*)0, this);
} }
wxMenuBar *CCodeWindow::GetMenuBar() wxMenuBar *CCodeWindow::GetMenuBar()
@ -163,11 +158,6 @@ wxAuiToolBar *CCodeWindow::GetToolBar()
// ---------- // ----------
// Events // Events
void CCodeWindow::OnKeyDown(wxKeyEvent& event)
{
event.Skip();
}
void CCodeWindow::OnHostMessage(wxCommandEvent& event) void CCodeWindow::OnHostMessage(wxCommandEvent& event)
{ {
switch (event.GetId()) switch (event.GetId())

View File

@ -143,7 +143,6 @@ class CCodeWindow
void UpdateLists(); void UpdateLists();
void UpdateCallstack(); void UpdateCallstack();
void OnKeyDown(wxKeyEvent& event);
void InitBitmaps(); void InitBitmaps();
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter); void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);

View File

@ -38,13 +38,7 @@
#include "StringUtil.h" #include "StringUtil.h"
#include "LogManager.h" #include "LogManager.h"
// ugly that this lib included code from the main #include "../Globals.h"
#include "../../DolphinWX/Src/Globals.h"
// TODO: Fix this ugly hack
namespace {
CJitWindow *the_jit_window;
}
enum enum
{ {
@ -67,7 +61,6 @@ CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos,
const wxSize& size, long style, const wxString& name) const wxSize& size, long style, const wxString& name)
: wxPanel(parent, id, pos, size, style, name) : wxPanel(parent, id, pos, size, style, name)
{ {
the_jit_window = this;
wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* sizerSplit = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* sizerSplit = new wxBoxSizer(wxHORIZONTAL);
sizerSplit->Add(ppc_box = new wxTextCtrl(this, IDM_PPC_BOX, _T("(ppc)"), sizerSplit->Add(ppc_box = new wxTextCtrl(this, IDM_PPC_BOX, _T("(ppc)"),
@ -97,16 +90,9 @@ void CJitWindow::OnRefresh(wxCommandEvent& /*event*/) {
void CJitWindow::ViewAddr(u32 em_address) void CJitWindow::ViewAddr(u32 em_address)
{ {
if (the_jit_window) Show(true);
{ Compare(em_address);
the_jit_window->Show(true); SetFocus();
the_jit_window->Compare(em_address);
the_jit_window->SetFocus();
}
else
{
PanicAlert("Jit window not available");
}
} }
void CJitWindow::Compare(u32 em_address) void CJitWindow::Compare(u32 em_address)

View File

@ -48,7 +48,7 @@ public:
long style = wxTAB_TRAVERSAL | wxBORDER_NONE, long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
const wxString& name = _("JIT block viewer")); const wxString& name = _("JIT block viewer"));
static void ViewAddr(u32 em_address); void ViewAddr(u32 em_address);
void Update(); void Update();
private: private:

View File

@ -557,7 +557,8 @@ void Host_UpdateDisasmDialog()
void Host_ShowJitResults(unsigned int address) void Host_ShowJitResults(unsigned int address)
{ {
CJitWindow::ViewAddr(address); if (main_frame->g_pCodeWindow && main_frame->g_pCodeWindow->m_JitWindow)
main_frame->g_pCodeWindow->m_JitWindow->ViewAddr(address);
} }
void Host_UpdateMainFrame() void Host_UpdateMainFrame()

View File

@ -144,7 +144,7 @@ void WiimoteConfigPage::UpdateWiimoteStatus()
// Connect wiimotes // Connect wiimotes
if (WIIMOTE_SRC_EMU & g_wiimote_sources[m_index]) if (WIIMOTE_SRC_EMU & g_wiimote_sources[m_index])
CFrame::ConnectWiimote(m_index, true); CFrame::ConnectWiimote(m_index, true);
else if (WIIMOTE_SRC_REAL & g_wiimote_sources[m_index]) else if (WIIMOTE_SRC_REAL & g_wiimote_sources[m_index] && WiimoteReal::g_wiimotes[m_index])
CFrame::ConnectWiimote(m_index, WiimoteReal::g_wiimotes[m_index]->IsConnected()); CFrame::ConnectWiimote(m_index, WiimoteReal::g_wiimotes[m_index]->IsConnected());
} }
} }