Avoid reloading the same DEM directory.
Fix segfault when a corrupted simlink is present in the DEM directory.
To set the directory containing the DEM in the DEMHandler, one calls
DEMHandler::OpenDEMDirectory. Due to how the Application framework works, with the DoUpdateParameters function being called for each parameter, the same directory may be set multiple times, unloading and loading the same data each time. To avoid this, we propose to modify the DEMHandler so it doesn't reload a directory if one calls
DEMHandler::OpenDEMDirectory with the same path.
Also, when there is a simlink in the DEM directory, if this simlink links to itself, it makes OTB exit with a segfault. We propose to handle this case correctly by ignoring this simlink.
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit