From 607511fd64e5b77f7cb2f2b740460511880b11ad Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Feb 2007 23:14:00 +0000 Subject: [PATCH] Don't crash when destroying a SGBinding object if the property node it was loaded from lacks a parent. Patch from ndim on IRC --- simgear/structure/SGBinding.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simgear/structure/SGBinding.cxx b/simgear/structure/SGBinding.cxx index acd91814..0c3f7feb 100644 --- a/simgear/structure/SGBinding.cxx +++ b/simgear/structure/SGBinding.cxx @@ -27,7 +27,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 -- 2.39.5