comparison src/video/qnxgf/SDL_qnxgf.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 fe9c8a5cab51
children 4b594623401b
comparison
equal deleted inserted replaced
3460:ba48701b0534 3461:87182c69e080
249 SDL_free(device); 249 SDL_free(device);
250 return NULL; 250 return NULL;
251 } 251 }
252 device->driverdata = gfdata; 252 device->driverdata = gfdata;
253 253
254 /* By default GF is not initialized */
255 gfdata->gfinitialized = SDL_FALSE;
256
254 /* Try to attach to graphics device driver */ 257 /* Try to attach to graphics device driver */
255 status = 258 status =
256 gf_dev_attach(&gfdata->gfdev, GF_DEVICE_INDEX(devindex), 259 gf_dev_attach(&gfdata->gfdev, GF_DEVICE_INDEX(devindex),
257 &gfdata->gfdev_info); 260 &gfdata->gfdev_info);
258 if (status != GF_ERR_OK) { 261 if (status != GF_ERR_OK) {
541 } 544 }
542 545
543 void 546 void
544 qnxgf_videoquit(_THIS) 547 qnxgf_videoquit(_THIS)
545 { 548 {
549 SDL_VideoData *gfdata = (SDL_VideoData *) _this->driverdata;
546 SDL_DisplayData *didata = NULL; 550 SDL_DisplayData *didata = NULL;
547 uint32_t it; 551 uint32_t it;
552
553 /* Check if GF was initialized before */
554 if ((gfdata == NULL) || (gfdata->gfinitialized != SDL_TRUE))
555 {
556 /* If not, do not deinitialize */
557 return;
558 }
548 559
549 /* Stop collecting mouse events */ 560 /* Stop collecting mouse events */
550 hiddi_disable_mouse(); 561 hiddi_disable_mouse();
551 /* Delete GF input devices */ 562 /* Delete GF input devices */
552 gf_delinputdevices(_this); 563 gf_delinputdevices(_this);