summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-02-20 14:39:09 -0500
committerTavian Barnes <tavianator@gmail.com>2011-02-20 14:39:09 -0500
commitbdaa9b42526cea72b30b400c1f40891a9204126d (patch)
treef2088e8b95188ad2b13ddcd8c0d62cf432800ba1
parent1fcc683b858c4c7fb00a9e02633886f2a0e4d9cb (diff)
downloaddimension-bdaa9b42526cea72b30b400c1f40891a9204126d.tar.xz
fclose() output_file if render fails.
-rw-r--r--dimension/main.c3
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;