X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInput%2FFGDeviceConfigurationMap.cxx;h=b4b6b1baf24d278812efb5990cc3df4e7f0f8bce;hb=f6207d5cb8eeb2ed83e1873dd2f621785832a3f3;hp=b8ce13505f83d35c817ff13c73d2dc19ac887175;hpb=674a295896a1e56d605f39874262d6f146a586a3;p=flightgear.git diff --git a/src/Input/FGDeviceConfigurationMap.cxx b/src/Input/FGDeviceConfigurationMap.cxx index b8ce13505..b4b6b1baf 100644 --- a/src/Input/FGDeviceConfigurationMap.cxx +++ b/src/Input/FGDeviceConfigurationMap.cxx @@ -26,8 +26,6 @@ # include #endif -#include - #include "FGDeviceConfigurationMap.hxx" #include @@ -41,6 +39,7 @@ FGDeviceConfigurationMap::FGDeviceConfigurationMap( const char * relative_path, childname(aChildname) { int index = 1000; + scan_dir( SGPath(globals->get_fg_home(), relative_path), &index); scan_dir( SGPath(globals->get_fg_root(), relative_path), &index); PropertyList childNodes = base->getChildren(childname); @@ -55,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)