From 5c789706630caf82d9043e61ee5e42d5e00b671f Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Sat, 25 Aug 2012 22:23:55 +0100 Subject: [PATCH] Stop the property tree from keeping a shadow of the deleted input properties, as it can mean that the array of bindings ends up with some incorrect name tags if the set of joystick config files changes and a given js-named entry shifts in the array. This can then result in incorrect bindings being selected. --- src/Input/FGDeviceConfigurationMap.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Input/FGDeviceConfigurationMap.cxx b/src/Input/FGDeviceConfigurationMap.cxx index 5680149f1..b4b6b1baf 100644 --- a/src/Input/FGDeviceConfigurationMap.cxx +++ b/src/Input/FGDeviceConfigurationMap.cxx @@ -54,7 +54,10 @@ FGDeviceConfigurationMap::FGDeviceConfigurationMap( const char * relative_path, FGDeviceConfigurationMap::~FGDeviceConfigurationMap() { - base->removeChildren( childname ); + // Ensure that the children don't hang around when deleted, as if + // re-created, we need to ensure that the set of names doesn't contain + // any unexpected history. + base->removeChildren( childname, false ); } void FGDeviceConfigurationMap::scan_dir(const SGPath & path, int *index) -- 2.39.5