]> git.mxchange.org Git - flightgear.git/commitdiff
Fix out of order initialization crash (not sure how it worked before
authorcurt <curt>
Wed, 11 Dec 2002 21:07:30 +0000 (21:07 +0000)
committercurt <curt>
Wed, 11 Dec 2002 21:07:30 +0000 (21:07 +0000)
unless some recent changes subtlely changed some init order items around.)

configure.ac
src/Main/fg_props.cxx
src/Main/globals.cxx

index 6c4d2eba6bb70fecb6b8ed48b86d4f095b48511a..57451ac45a73ec6e8e791e3ed38fa2df13ab2c56 100644 (file)
@@ -190,6 +190,20 @@ dnl Thread related checks
 AC_CHECK_LIB(pthread, pthread_exit)
 AC_CHECK_LIB(socket, socket)
 
+dnl check for glut location
+AC_CHECK_HEADER(GL/glut.h)
+if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
+    AC_DEFINE([GLUT_H], "GL/glut.h", [Define as glut.h include location])
+else
+    AC_CHECK_HEADER(GLUT/glut.h)
+    if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
+        AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location])
+    else
+        echo "Neither GL/glut.h nor GLUT/glut.h found.  Cannot continue"
+        exit
+    fi
+fi
+
 dnl check for OpenGL related libraries
 case "${host}" in
 *-*-cygwin* | *-*-mingw32*)
@@ -266,20 +280,6 @@ case "${host}" in
 
 esac
 
-dnl check for glut location
-AC_CHECK_HEADER(GL/glut.h)
-if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
-    AC_DEFINE([GLUT_H], "GL/glut.h", [Define as glut.h include location])
-else
-    AC_CHECK_HEADER(GLUT/glut.h)
-    if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
-        AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location])
-    else
-        echo "Neither GL/glut.h nor GLUT/glut.h found.  Cannot continue"
-        exit
-    fi
-fi
-
 opengl_LIBS="$LIBS"
 LIBS="$base_LIBS"
 
index b84688aeb0b05438667680bca3dc697aed0ca523..93c205d1e7f80cd1878c34ba99aeabaad7382ba6 100644 (file)
@@ -233,12 +233,17 @@ getFreeze ()
 static void
 setFreeze (bool f)
 {
-  frozen = f;
-                               // Stop sound on a pause
-  if (f)
-    globals->get_soundmgr()->pause();
-  else
-    globals->get_soundmgr()->resume();
+    frozen = f;
+
+    // Stop sound on a pause
+    FGSoundMgr *s = globals->get_soundmgr();
+    if ( s != NULL ) {
+        if ( f ) {
+            s->pause();
+        } else {
+            s->resume();
+        }
+    }
 }
 
 
index b8341e4c755e960e1fc90bfc7123585c6161fe63..ee093bada0d3be73cb19de97cad714e01823a5b0 100644 (file)
@@ -42,18 +42,40 @@ FGGlobals *globals;
 
 // Constructor
 FGGlobals::FGGlobals() :
-    subsystem_mgr(new FGSubsystemMgr),
-    sim_time_sec(0.0),
+    subsystem_mgr( new FGSubsystemMgr ),
+    sim_time_sec( 0.0 ),
+    fg_root( "" ),
+    fg_scenery( "" ),
 #if defined(FX) && defined(XMESA)
     fullscreen( true ),
 #endif
     warp( 0 ),
     warp_delta( 0 ),
-    props(new SGPropertyNode),
-    initial_state(0),
-    locale(NULL),
-    commands(new SGCommandMgr),
-    io(new FGIO)
+    time_params( NULL ),
+    ephem( NULL ),
+    mag( NULL ),
+    autopilot( NULL ),
+    route( NULL ),
+    soundmgr( NULL ),
+    environment_mgr( NULL ),
+    ATC_mgr( NULL ),
+    ATC_display( NULL ),
+    AI_mgr( NULL ),
+    controls( NULL ),
+    steam( NULL ),
+    viewmgr( NULL ),
+    props( new SGPropertyNode ),
+    initial_state( NULL ),
+    locale( NULL ),
+    commands( new SGCommandMgr ),
+    model_loader( NULL ),
+    texture_loader( NULL ),
+    acmodel( NULL ),
+    model_mgr( NULL ),
+    channel_options_list( NULL ),
+    scenery( NULL ),
+    tile_mgr( NULL ),
+    io( new FGIO )
 {
 }