diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-02-20 14:39:09 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-02-20 14:39:09 -0500 |
commit | bdaa9b42526cea72b30b400c1f40891a9204126d (patch) | |
tree | f2088e8b95188ad2b13ddcd8c0d62cf432800ba1 | |
parent | 1fcc683b858c4c7fb00a9e02633886f2a0e4d9cb (diff) | |
download | dimension-bdaa9b42526cea72b30b400c1f40891a9204126d.tar.xz |
fclose() output_file if render fails.
-rw-r--r-- | dimension/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dimension/main.c b/dimension/main.c index 5274bdf..f8b86b4 100644 --- a/dimension/main.c +++ b/dimension/main.c @@ -307,6 +307,7 @@ main(int argc, char **argv) scene->nthreads); if (dmnsn_finish_progress(render_progress) != 0) { + fclose(output_file); dmnsn_delete_timer(parse_timer); dmnsn_delete_scene(scene); fprintf(stderr, "Error rendering scene!\n"); @@ -318,8 +319,8 @@ main(int argc, char **argv) dmnsn_progress *output_progress = dmnsn_png_write_canvas_async(scene->canvas, output_file); if (!output_progress) { - dmnsn_delete_timer(parse_timer); fclose(output_file); + dmnsn_delete_timer(parse_timer); dmnsn_delete_scene(scene); fprintf(stderr, "Couldn't initialize PNG export!\n"); return EXIT_FAILURE; |