From: andy Date: Wed, 14 Feb 2007 23:14:00 +0000 (+0000) Subject: Don't crash when destroying a SGBinding object if the property node it X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=607511fd64e5b77f7cb2f2b740460511880b11ad;p=simgear.git Don't crash when destroying a SGBinding object if the property node it was loaded from lacks a parent. Patch from ndim on IRC --- 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