mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
util/foz: stop crashing on destroy if prepare hasn't been called
Fixes: eca6bb9540 ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11931>
This commit is contained in:
parent
d27f7fa1b3
commit
2850db0a9e
1 changed files with 2 additions and 1 deletions
|
|
@ -334,7 +334,8 @@ foz_prepare(struct foz_db *foz_db, char *cache_path)
|
|||
void
|
||||
foz_destroy(struct foz_db *foz_db)
|
||||
{
|
||||
fclose(foz_db->db_idx);
|
||||
if (foz_db->db_idx)
|
||||
fclose(foz_db->db_idx);
|
||||
for (unsigned i = 0; i < FOZ_MAX_DBS; i++) {
|
||||
if (foz_db->file[i])
|
||||
fclose(foz_db->file[i]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue