From 0c8d84aad1711dd8f15d878a4c0131b8a86de8ea Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 29 Aug 2013 22:12:00 +0100 Subject: [PATCH] Fix crash on re-position with FGCom. 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Network/fgcom.cxx b/src/Network/fgcom.cxx index 95f06333b..2068e0348 100644 --- a/src/Network/fgcom.cxx +++ b/src/Network/fgcom.cxx @@ -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 {