src/video/directfb/SDL_DirectFB_video.c
changeset 759 26ac9609211f
parent 732 d18e2b224d0e
child 767 d9e79e31a7b7
     1.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Thu Dec 18 05:01:47 2003 +0000
     1.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Mon Dec 22 01:21:20 2003 +0000
     1.3 @@ -1075,14 +1075,21 @@
     1.4  void DirectFB_VideoQuit(_THIS)
     1.5  {
     1.6    struct DirectFBEnumRect *rect    = enumlist;
     1.7 -  IDirectFBSurface        *surface = this->screen->hwdata->surface;
     1.8 -  IDirectFBPalette        *palette = this->screen->hwdata->palette;
     1.9 +
    1.10 +  if (this->screen->hwdata)
    1.11 +    {
    1.12 +      IDirectFBSurface        *surface = this->screen->hwdata->surface;
    1.13 +      IDirectFBPalette        *palette = this->screen->hwdata->palette;
    1.14  
    1.15 -  if (palette)
    1.16 -    palette->Release (palette);
    1.17 +      if (palette)
    1.18 +        palette->Release (palette);
    1.19  
    1.20 -  if (surface)
    1.21 -    surface->Release (surface);
    1.22 +      if (surface)
    1.23 +        surface->Release (surface);
    1.24 +
    1.25 +      this->screen->hwdata->surface = NULL;
    1.26 +      this->screen->hwdata->palette = NULL;
    1.27 +    }
    1.28  
    1.29    if (HIDDEN->c2frame)
    1.30      {