vkd3d-dxbc: Close output files after writing them.

This commit is contained in:
Henri Verbeet 2024-04-03 17:56:52 +02:00 committed by Alexandre Julliard
parent 8653ce17cf
commit 2712a79c55
Notes: Alexandre Julliard 2024-04-04 22:42:25 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/755

View File

@ -514,6 +514,7 @@ int main(int argc, char **argv)
FILE *input, *output;
char *messages;
uint32_t flags;
bool success;
int fail = 1;
size_t i;
int ret;
@ -583,18 +584,15 @@ int main(int argc, char **argv)
goto done;
}
if (!write_output(output, &serialized))
{
if (!(success = write_output(output, &serialized)))
fprintf(stderr, "Failed to write output blob.\n");
if (close_output)
fclose(output);
vkd3d_shader_free_shader_code(&serialized);
if (!success)
goto done;
}
vkd3d_shader_free_shader_code(&serialized);
break;
default:
vkd3d_unreachable();
}
}
@ -605,7 +603,5 @@ done:
free(options.actions);
if (close_input)
fclose(input);
if (close_output)
fclose(output);
return fail;
}