comparison src/video/directfb/SDL_DirectFB_video.c @ 759:26ac9609211f

From: Thomas Jarosch To: Ryan C. Gordon Subject: SDL: DirectFB videodriver segfault Date: Sun, 21 Dec 2003 20:40:14 +0100 Hi Ryan, attached is a patch to fix a segfault in DirectFB_VideoQuit. When SetVideoMode never gets called (f.e. wrong command line arguments for "testsprite"), this->screen->hwdata is NULL. Cheers, Thomas
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 22 Dec 2003 01:21:20 +0000
parents d18e2b224d0e
children d9e79e31a7b7
comparison
equal deleted inserted replaced
758:619fc21d154e 759:26ac9609211f
1073 } 1073 }
1074 1074
1075 void DirectFB_VideoQuit(_THIS) 1075 void DirectFB_VideoQuit(_THIS)
1076 { 1076 {
1077 struct DirectFBEnumRect *rect = enumlist; 1077 struct DirectFBEnumRect *rect = enumlist;
1078 IDirectFBSurface *surface = this->screen->hwdata->surface; 1078
1079 IDirectFBPalette *palette = this->screen->hwdata->palette; 1079 if (this->screen->hwdata)
1080 1080 {
1081 if (palette) 1081 IDirectFBSurface *surface = this->screen->hwdata->surface;
1082 palette->Release (palette); 1082 IDirectFBPalette *palette = this->screen->hwdata->palette;
1083 1083
1084 if (surface) 1084 if (palette)
1085 surface->Release (surface); 1085 palette->Release (palette);
1086
1087 if (surface)
1088 surface->Release (surface);
1089
1090 this->screen->hwdata->surface = NULL;
1091 this->screen->hwdata->palette = NULL;
1092 }
1086 1093
1087 if (HIDDEN->c2frame) 1094 if (HIDDEN->c2frame)
1088 { 1095 {
1089 HIDDEN->c2frame->Release (HIDDEN->c2frame); 1096 HIDDEN->c2frame->Release (HIDDEN->c2frame);
1090 HIDDEN->c2frame = NULL; 1097 HIDDEN->c2frame = NULL;