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

View File

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

View File

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

View File

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

View File

@ -557,7 +557,8 @@ void Host_UpdateDisasmDialog()
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()

View File

@ -144,7 +144,7 @@ void WiimoteConfigPage::UpdateWiimoteStatus()
// Connect wiimotes
if (WIIMOTE_SRC_EMU & g_wiimote_sources[m_index])
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());
}
}