]> git.mxchange.org Git - flightgear.git/commitdiff
Fix crash on re-position with FGCom.
authorJames Turner <zakalawe@mac.com>
Thu, 29 Aug 2013 21:12:00 +0000 (22:12 +0100)
committerJames Turner <zakalawe@mac.com>
Thu, 29 Aug 2013 21:12:00 +0000 (22:12 +0100)
Don't assume valueChanged firing means the value has actually
changed; various operations (eg, copyProperties) can also
cause the signals to fire.

src/Network/fgcom.cxx

index 95f06333b13bc5a9ee1123831a2e2980a97e0d4b..2068e03484f85959d57f177a8fdb4efc530fe0de 100644 (file)
@@ -402,7 +402,12 @@ void FGCom::shutdown()
 void FGCom::valueChanged(SGPropertyNode *prop)
 {
   if (prop == _enabled_node) {
-    if( prop->getBoolValue() ) {
+      bool isEnabled = prop->getBoolValue();
+      if (_enabled == isEnabled) {
+          return;
+      }
+      
+    if( isEnabled ) {
       init();
       postinit();
     } else {