mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
Fix crash when GL nodes file cannot be opened for writing
Report errors to console if nodes file cannot be opened or written
This commit is contained in:
parent
9cd074ddf3
commit
3e7b0c2916
1 changed files with 15 additions and 2 deletions
|
@ -1168,8 +1168,21 @@ static void CreateCachedNodes(MapData *map)
|
||||||
|
|
||||||
FString path = CreateCacheName(map, true);
|
FString path = CreateCacheName(map, true);
|
||||||
FILE *f = fopen(path, "wb");
|
FILE *f = fopen(path, "wb");
|
||||||
fwrite(compressed, 1, outlen+offset, f);
|
|
||||||
fclose(f);
|
if (f != NULL)
|
||||||
|
{
|
||||||
|
if (fwrite(compressed, outlen+offset, 1, f) != 1)
|
||||||
|
{
|
||||||
|
Printf("Error saving nodes to file %s\n", path.GetChars());
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Printf("Cannot open nodes file %s for writing\n", path.GetChars());
|
||||||
|
}
|
||||||
|
|
||||||
delete [] compressed;
|
delete [] compressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue