frontend: Change crash sentinel location to separate subdirectory #12554
+10
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Moves crash sentinel files into their own subdirectory inside the application configuration directory to ensure that clean-up operations will not encounter important user data.
Motivation and Context
Putting the crash sentinel in the main "obs-studio" directory carries the risk of unwanted deletion of files in the same directory, which usually contains user configuration files like "user.ini" and "global.ini".
Even though the code will ignore any file that does not start with the crash sentinel prefix string, the code itself would allow changing the prefix to "global.ini" and thus inadvertently delete the global configuration file as well.
To further reduce the risk, this change will put the sentinels in a separate sub-directory that should only ever contain sentinel files, all of which can possibly deleted without any data loss for the user.
While the potential error case is hypothetical, application configuration data is important enough to err on the side of caution here.
How Has This Been Tested?
Tested on macOS 15 with a clean run of OBS Studio and confirmed that the non-existing subdirectory is created on launch and the sentinel file placed, as well as removed on successful shutdown only. Also checked that any prior sentinels are correctly removed on a successful shutdown.
Types of changes
Checklist: