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:
Shawn Hoffman
2010-04-10 14:39:54 +00:00
parent 474363bc27
commit 4b5b074b81
7 changed files with 56 additions and 15 deletions

View File

@ -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;
}