From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / glx / sproingies.c
index 11bbcf5f1a4e9b7721dba31738106c31009f1b16..4752d41d79a59a0c00ff58636d7d062e85169be5 100644 (file)
@@ -36,7 +36,7 @@ static const char sccsid[] = "@(#)sproingies.c        4.04 97/07/28 xlockmore";
 
 #ifdef USE_GL
 
-#if !defined(HAVE_COCOA) && !defined(HAVE_ANDROID)
+#if !defined(HAVE_JWZGLES) && !defined(HAVE_COCOA)
 # include <GL/glu.h>
 #endif
 
@@ -764,6 +764,9 @@ void
 CleanupSproingies(int screen)
 {
        sp_instance *si = &si_list[screen];
+
+    if (! si) return;
+
 /*
        int         t;
        if (si->SproingieBoom) {
@@ -808,6 +811,9 @@ InitSproingies(int wfmode, int grnd, int mspr, int smrtspr,
        sp_instance *si;
        int         t;
 
+       active_screens++;
+       CleanupSproingies(screen);
+
        if (si_list == NULL) {
                if ((si_list = (sp_instance *) calloc(numscreens,
                                              sizeof (sp_instance))) == NULL)
@@ -815,9 +821,6 @@ InitSproingies(int wfmode, int grnd, int mspr, int smrtspr,
        }
        si = &si_list[screen];
 
-       active_screens++;
-       CleanupSproingies(screen);
-
        if (mspr < 0)
                mspr = 0;
        if (mspr >= MAXSPROING)