Fixed crash in GGI detection
authorSam Lantinga <slouken@lokigames.com>
Thu, 10 May 2001 18:10:19 +0000
changeset 17 4f22a992f5e9
parent 16 735e5a8696d0
child 18 d9e3595b63d5
Fixed crash in GGI detection
src/video/ggi/SDL_ggivideo.c
--- a/src/video/ggi/SDL_ggivideo.c	Thu May 10 18:04:03 2001 +0000
+++ b/src/video/ggi/SDL_ggivideo.c	Thu May 10 18:10:19 2001 +0000
@@ -75,11 +75,13 @@
 static int GGI_Available(void)
 {
 	ggi_visual_t *vis;
-	
-	vis = ggiOpen(NULL);
-	if (vis != NULL) 
-	{
-		ggiClose(vis);
+
+	vis = NULL;
+	if (ggiInit() == 0) {
+		vis = ggiOpen(NULL);
+		if (vis != NULL) {
+			ggiClose(vis);
+		}
 	}
 	return (vis != NULL);
 }