]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_props.cxx
Bug #99 - change viewer damping calculation, to work correctly regardless of set...
[flightgear.git] / src / Main / fg_props.cxx
index 6a54db66515efc2e9ba5185b9fdd5df2a3db79c7..31f4ae0dac7f5403c1d706349c7ba24d51ff7293 100644 (file)
@@ -85,20 +85,26 @@ LogClassMapping log_class_mappings [] = {
 /**
  * Get the logging classes.
  */
+// XXX Making the result buffer be global is a band-aid that hopefully
+// delays its destruction 'til after its last use.
+namespace
+{
+string loggingResult;
+}
+
 static const char *
 getLoggingClasses ()
 {
   sgDebugClass classes = logbuf::get_log_classes();
-  static string result;
-  result = "";
+  loggingResult.clear();
   for (int i = 0; log_class_mappings[i].c != SG_UNDEFD; i++) {
     if ((classes&log_class_mappings[i].c) > 0) {
-      if (!result.empty())
-       result += '|';
-      result += log_class_mappings[i].name;
+      if (!loggingResult.empty())
+       loggingResult += '|';
+      loggingResult += log_class_mappings[i].name;
     }
   }
-  return result.c_str();
+  return loggingResult.c_str();
 }
 
 
@@ -222,11 +228,11 @@ setFreeze (bool f)
     frozen = f;
 
     // Stop sound on a pause
-    SGSoundMgr *smgr = (SGSoundMgr *)globals->get_subsystem("soundmgr");
+    SGSoundMgr *smgr = globals->get_soundmgr();
     if ( smgr != NULL ) {
         if ( f ) {
             smgr->suspend();
-        } else if (!fgGetBool("/sim/sound/pause")) {
+        } else if (fgGetBool("/sim/sound/working")) {
             smgr->resume();
         }
     }