Mercurial > sdl-ios-xcode
comparison src/video/qnxgf/SDL_gf_input.c @ 3461:87182c69e080
Deinitialization fixes, in case if QNXGF driver is not initialized properly.
author | Mike Gorchak <lestat@i.com.ua> |
---|---|
date | Fri, 20 Nov 2009 07:06:50 +0000 |
parents | 7f684f249ec9 |
children | 4b594623401b |
comparison
equal
deleted
inserted
replaced
3460:ba48701b0534 | 3461:87182c69e080 |
---|---|
1069 SDL_memset(mouse_last_state_button, 0x00, | 1069 SDL_memset(mouse_last_state_button, 0x00, |
1070 sizeof(uint32_t) * SDL_HIDDI_MAX_DEVICES); | 1070 sizeof(uint32_t) * SDL_HIDDI_MAX_DEVICES); |
1071 | 1071 |
1072 status = hidd_connect(&hidparams, &connection); | 1072 status = hidd_connect(&hidparams, &connection); |
1073 if (status != EOK) { | 1073 if (status != EOK) { |
1074 connection=NULL; | |
1074 return -1; | 1075 return -1; |
1075 } | 1076 } |
1076 | 1077 |
1077 for (it = 0; it < SDL_HIDDI_MAX_DEVICES; it++) { | 1078 for (it = 0; it < SDL_HIDDI_MAX_DEVICES; it++) { |
1078 /* Get device instance */ | 1079 /* Get device instance */ |
1095 } | 1096 } |
1096 | 1097 |
1097 /* Disconnect from HID server */ | 1098 /* Disconnect from HID server */ |
1098 status = hidd_disconnect(connection); | 1099 status = hidd_disconnect(connection); |
1099 if (status != EOK) { | 1100 if (status != EOK) { |
1101 connection=NULL; | |
1100 return -1; | 1102 return -1; |
1101 } | 1103 } |
1102 | 1104 |
1103 /* Add handlers for HID devices */ | 1105 /* Add handlers for HID devices */ |
1104 hidparams.funcs = &hidfuncs; | 1106 hidparams.funcs = &hidfuncs; |
1105 | 1107 |
1106 status = hidd_connect(&hidparams, &connection); | 1108 status = hidd_connect(&hidparams, &connection); |
1107 if (status != EOK) { | 1109 if (status != EOK) { |
1110 connection=NULL; | |
1108 return -1; | 1111 return -1; |
1109 } | 1112 } |
1110 | 1113 |
1111 return 0; | 1114 return 0; |
1112 } | 1115 } |
1117 int32_t status; | 1120 int32_t status; |
1118 | 1121 |
1119 hiddi_disable_mouse(); | 1122 hiddi_disable_mouse(); |
1120 | 1123 |
1121 /* Disconnect from HID server */ | 1124 /* Disconnect from HID server */ |
1122 status = hidd_disconnect(connection); | 1125 if (connection!=NULL) |
1123 if (status != EOK) { | 1126 { |
1124 return -1; | 1127 status = hidd_disconnect(connection); |
1128 if (status != EOK) { | |
1129 return -1; | |
1130 } | |
1125 } | 1131 } |
1126 } | 1132 } |
1127 | 1133 |
1128 void | 1134 void |
1129 hiddi_enable_mouse() | 1135 hiddi_enable_mouse() |