src/video/uikit/SDL_uikitvideo.m
changeset 6014 7a8b72b88d86
parent 6013 b253cc3c4276
parent 5997 69875bbf83d8
child 6018 fa4a3c1d857b
equal deleted inserted replaced
6013:b253cc3c4276 6014:7a8b72b88d86
   174     mode.format = SDL_PIXELFORMAT_ABGR8888;
   174     mode.format = SDL_PIXELFORMAT_ABGR8888;
   175     mode.w = w;
   175     mode.w = w;
   176     mode.h = h;
   176     mode.h = h;
   177     mode.refresh_rate = 0;
   177     mode.refresh_rate = 0;
   178 
   178 
   179     [uimode retain];
   179     [uimode retain];  // once for the desktop_mode
       
   180     [uimode retain];  // once for the current_mode
   180     mode.driverdata = uimode;
   181     mode.driverdata = uimode;
   181 
   182 
   182     SDL_zero(display);
   183     SDL_zero(display);
   183     display.desktop_mode = mode;
   184     display.desktop_mode = mode;
   184     display.current_mode = mode;
   185     display.current_mode = mode;
   246     for (i = 0; i < _this->num_displays; i++) {
   247     for (i = 0; i < _this->num_displays; i++) {
   247         SDL_VideoDisplay *display = &_this->displays[i];
   248         SDL_VideoDisplay *display = &_this->displays[i];
   248         UIScreen *uiscreen = (UIScreen *) display->driverdata;
   249         UIScreen *uiscreen = (UIScreen *) display->driverdata;
   249         [uiscreen release];
   250         [uiscreen release];
   250         display->driverdata = NULL;
   251         display->driverdata = NULL;
       
   252         [((UIScreenMode *) display->desktop_mode.driverdata) release];
       
   253         display->desktop_mode.driverdata = NULL;
       
   254         [((UIScreenMode *) display->current_mode.driverdata) release];
       
   255         display->current_mode.driverdata = NULL;
   251         for (j = 0; j < display->num_display_modes; j++) {
   256         for (j = 0; j < display->num_display_modes; j++) {
   252             SDL_DisplayMode *mode = &display->display_modes[j];
   257             SDL_DisplayMode *mode = &display->display_modes[j];
   253             UIScreenMode *uimode = (UIScreenMode *) mode->driverdata;
   258             [((UIScreenMode *) mode->driverdata) release];
   254             if (uimode) {
   259             mode->driverdata = NULL;
   255                 [uimode release];
       
   256                 mode->driverdata = NULL;
       
   257             }
       
   258         }
   260         }
   259     }
   261     }
   260 }
   262 }
   261 
   263 
   262 /* vi: set ts=4 sw=4 expandtab: */
   264 /* vi: set ts=4 sw=4 expandtab: */