comparison src/video/ggi/SDL_ggivideo.c @ 17:4f22a992f5e9

Fixed crash in GGI detection
author Sam Lantinga <slouken@lokigames.com>
date Thu, 10 May 2001 18:10:19 +0000
parents 74212992fb08
children e8157fcb3114
comparison
equal deleted inserted replaced
16:735e5a8696d0 17:4f22a992f5e9
73 /* GGI driver bootstrap functions */ 73 /* GGI driver bootstrap functions */
74 74
75 static int GGI_Available(void) 75 static int GGI_Available(void)
76 { 76 {
77 ggi_visual_t *vis; 77 ggi_visual_t *vis;
78 78
79 vis = ggiOpen(NULL); 79 vis = NULL;
80 if (vis != NULL) 80 if (ggiInit() == 0) {
81 { 81 vis = ggiOpen(NULL);
82 ggiClose(vis); 82 if (vis != NULL) {
83 ggiClose(vis);
84 }
83 } 85 }
84 return (vis != NULL); 86 return (vis != NULL);
85 } 87 }
86 88
87 static void GGI_DeleteDevice(SDL_VideoDevice *device) 89 static void GGI_DeleteDevice(SDL_VideoDevice *device)