X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2FSGBinding.cxx;h=9e5fce06a5a3745a5e79dfa8b8b5bc2b5e42beaa;hb=6a07c2282673562f67d12d31cd618be85d80f45a;hp=acd91814c50ebec4cefcbf64b966f2bb51ddd194;hpb=2ea2f1b4f29afe7d74e0474ca02874387526e804;p=simgear.git diff --git a/simgear/structure/SGBinding.cxx b/simgear/structure/SGBinding.cxx index acd91814..9e5fce06 100644 --- a/simgear/structure/SGBinding.cxx +++ b/simgear/structure/SGBinding.cxx @@ -7,9 +7,15 @@ * $Id$ */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include "SGBinding.hxx" +#include + SGBinding::SGBinding() : _command(0), _arg(new SGPropertyNode), @@ -27,7 +33,8 @@ SGBinding::SGBinding(const SGPropertyNode* node, SGPropertyNode* root) SGBinding::~SGBinding() { - _arg->getParent()->removeChild(_arg->getName(), _arg->getIndex(), false); + if(_arg && _arg->getParent()) + _arg->getParent()->removeChild(_arg->getName(), _arg->getIndex(), false); } void @@ -41,7 +48,6 @@ SGBinding::read(const SGPropertyNode* node, SGPropertyNode* root) if (_command_name.empty()) { SG_LOG(SG_INPUT, SG_WARN, "No command supplied for binding."); _command = 0; - return; } _arg = const_cast(node);