graphics: Do not load JSON ICDs multiple times from the same dirs
When we build the search paths for the JSON ICDs it might happen to have the same directory multiple times. For example if we have "XDG_CONFIG_DIRS=/usr/share" and "XDG_DATA_DIRS=/usr/share" we will look in "/usr/share" two times and duplicate all the JSONs that we find.
Usually this is not an issue but with some games, e.g. Red Dead Redemption 2, this can cause a crash at startup https://github.com/ValveSoftware/steam-runtime/issues/336
With this commit we filter out the directories that we already visited to prevent this kind of issues.
Fixes: #48
/cc @smcv
Merge request reports
Activity
It seems to work as expected by avoiding binding multiple times the same JSON ICD, but I haven't tested RDR 2 because I currently don't have it.
Even if in the end this would not completely solve the reported RDR 2 issue, I guess that this patch can still be considered useful to avoid unnecessary duplication in the container.
- Resolved by Ludovico de Nittis
- Resolved by Ludovico de Nittis
- Resolved by Ludovico de Nittis
added 1 commit
- fa764426 - graphics: Do not load JSON ICDs multiple times from the same dirs
mentioned in commit 736ee26e