mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
sanchez's patch for real wiimote pair-up, unexpected disconnect, and wiiuse resource leakage.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5313 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
15
Externals/WiiUseSrc/Src/wiiuse.c
vendored
15
Externals/WiiUseSrc/Src/wiiuse.c
vendored
@ -172,13 +172,6 @@ void wiiuse_disconnected(struct wiimote_t* wm) {
|
||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
||||
|
||||
/* reset a bunch of stuff */
|
||||
#ifndef WIN32
|
||||
wm->out_sock = -1;
|
||||
wm->in_sock = -1;
|
||||
#else
|
||||
wm->dev_handle = 0;
|
||||
#endif
|
||||
|
||||
wm->leds = 0;
|
||||
wm->state = WIIMOTE_INIT_STATES;
|
||||
wm->read_req = NULL;
|
||||
@ -188,6 +181,14 @@ void wiiuse_disconnected(struct wiimote_t* wm) {
|
||||
wm->btns_released = 0;
|
||||
memset(wm->event_buf, 0, sizeof(wm->event_buf));
|
||||
|
||||
#ifndef WIN32
|
||||
wm->out_sock = -1;
|
||||
wm->in_sock = -1;
|
||||
#else
|
||||
CloseHandle(wm->dev_handle);
|
||||
wm->dev_handle = 0;
|
||||
#endif
|
||||
|
||||
wm->event = WIIUSE_DISCONNECT;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user