updater: Check return values in ClearShaderCache

Invoking filesystem::remove_all on potentially truncated paths seems
like a bad idea.
This commit is contained in:
Richard Stanway
2026-02-18 15:26:28 -05:00
committed by Ryan Foster
parent 9185489586
commit 6340d7a845
+5 -3
View File
@@ -1235,9 +1235,11 @@ static void UpdateRegistryVersion(const Manifest &manifest)
static void ClearShaderCache()
{
wchar_t shader_path[MAX_PATH];
SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, shader_path);
StringCbCatW(shader_path, sizeof(shader_path), L"\\obs-studio\\shader-cache");
filesystem::remove_all(shader_path);
if (SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, shader_path) == S_OK) {
if (SUCCEEDED(StringCbCatW(shader_path, sizeof(shader_path), L"\\obs-studio\\shader-cache"))) {
filesystem::remove_all(shader_path);
}
}
}
extern "C" void UpdateHookFiles(void);