Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix reference to deleted object bug. This should fix channels not loa…
…ding from sysmenu anymore.
  • Loading branch information
Parlane committed Jan 8, 2013
1 parent 815fd19 commit 2844708
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
Expand Up @@ -795,6 +795,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
std::string tContentFile(m_ContentFile.c_str());
WII_IPC_HLE_Interface::Reset(true);
WII_IPC_HLE_Interface::Init();
s_Usb = GetUsbPointer();
for (unsigned int i = 0; i < s_Usb->m_WiiMotes.size(); i++)
{
if (wiiMoteConnected[i])
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
Expand Up @@ -38,7 +38,7 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De
// Activate only first Wiimote by default

_conf_pads BT_DINF;

SetUsbPointer(this);
if (!SConfig::GetInstance().m_SYSCONF->GetArrayData("BT.DINF", (u8*)&BT_DINF, sizeof(_conf_pads)))
{
PanicAlertT("Trying to read from invalid SYSCONF\nWiimote bt ids are not available");
Expand Down Expand Up @@ -100,6 +100,7 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De
CWII_IPC_HLE_Device_usb_oh1_57e_305::~CWII_IPC_HLE_Device_usb_oh1_57e_305()
{
m_WiiMotes.clear();
SetUsbPointer(NULL);
}

void CWII_IPC_HLE_Device_usb_oh1_57e_305::DoState(PointerWrap &p)
Expand Down
10 changes: 7 additions & 3 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp
Expand Up @@ -27,13 +27,19 @@
#include "l2cap.h" // Local
#include "WiiMote_HID_Attr.h"

static CWII_IPC_HLE_Device_usb_oh1_57e_305* s_Usb;
static CWII_IPC_HLE_Device_usb_oh1_57e_305* s_Usb = NULL;

CWII_IPC_HLE_Device_usb_oh1_57e_305* GetUsbPointer()
{
return s_Usb;
}

void SetUsbPointer(CWII_IPC_HLE_Device_usb_oh1_57e_305* ptr)
{
s_Usb = ptr;
}


CWII_IPC_HLE_WiiMote::CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305* _pHost, int _Number, bdaddr_t _BD, bool ready)
: m_HIDControlChannel_Connected(false)
, m_HIDControlChannel_ConnectedWait(false)
Expand All @@ -49,8 +55,6 @@ CWII_IPC_HLE_WiiMote::CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305*
{
DEBUG_LOG(WII_IPC_WIIMOTE, "Wiimote: #%i Constructed", _Number);

s_Usb = _pHost;

m_ConnectionState = (ready) ? CONN_READY : CONN_INACTIVE;
m_ConnectionHandle = 0x100 + _Number;
memset(m_LinkKey, 0xA0 + _Number, HCI_KEY_SIZE);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h
Expand Up @@ -25,6 +25,7 @@
class CWII_IPC_HLE_Device_usb_oh1_57e_305;

CWII_IPC_HLE_Device_usb_oh1_57e_305* GetUsbPointer();
void SetUsbPointer(CWII_IPC_HLE_Device_usb_oh1_57e_305* ptr);

class CBigEndianBuffer
{
Expand Down

0 comments on commit 2844708

Please sign in to comment.