]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_props.cxx
Merge branch 'jmt/runway-fix' into next
[flightgear.git] / src / Main / fg_props.cxx
index dfce13c132c2425f3f2a599784a0a301b23e4520..787e85ab57de008516347d9a8185b71919d17455 100644 (file)
@@ -31,6 +31,7 @@
 #include <simgear/magvar/magvar.hxx>
 #include <simgear/timing/sg_time.hxx>
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/scene/model/particles.hxx>
 #include <simgear/sound/soundmgr_openal.hxx>
 
 #include <Aircraft/aircraft.hxx>
@@ -85,20 +86,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();
 }
 
 
@@ -230,6 +237,9 @@ setFreeze (bool f)
             smgr->resume();
         }
     }
+
+    // Pause the particle system
+    simgear::Particles::setFrozen(f);
 }