]> granicus.if.org Git - graphviz/commitdiff
can't fflush() when using zlib compression.
authorellson <devnull@localhost>
Tue, 8 Aug 2006 14:34:41 +0000 (14:34 +0000)
committerellson <devnull@localhost>
Tue, 8 Aug 2006 14:34:41 +0000 (14:34 +0000)
lib/common/emit.c
plugin/core/gvrender_core.c

index 39f141b13dc08a8456e734c64bbceb6d927eef4f..0a9a6fd9909a7dbce0c4321cc95450c076a0b7fe 100644 (file)
@@ -2527,7 +2527,7 @@ static void emit_job(GVJ_t * job, graph_t * g)
         emit_graph(job, g);
 
     /* Flush is necessary because we may be writing to a pipe. */
-    if (! job->external_surface && job->output_lang != TK)
+    if (job->output_file && ! job->external_surface && job->output_lang != TK)
         fflush(job->output_file);
 }
 
index 2494ab8653272381549af33c73451ab00677b8c8..796e5a243616642eccd77db59befa950daa34b0c 100644 (file)
@@ -75,6 +75,7 @@ void core_fini_compression(GVJ_t *job)
     case COMPRESSION_ZLIB:
 #ifdef HAVE_LIBZ
         gzclose((gzFile *) (job->output_file));
+       job->output_file = NULL;
         break;
 #else
         (job->common->errorfn) ("No libz support\n");