]> granicus.if.org Git - graphviz/commitdiff
don't close files that are really tclChannels
authorellson <devnull@localhost>
Thu, 6 Jul 2006 17:28:45 +0000 (17:28 +0000)
committerellson <devnull@localhost>
Thu, 6 Jul 2006 17:28:45 +0000 (17:28 +0000)
lib/gvc/gvdevice.c
tclpkg/tcldot/tcldot.c

index a2e1274e2ee8886e0ec25d79dd9fa3eee75f67fa..d447744ad658c53b919e2100155716ad0febd894 100644 (file)
@@ -98,12 +98,13 @@ void gvdevice_finalize(GVC_t * gvc)
 
     /* FIXME - file output should be its own device */
     while(active_job) {
-       if (active_job->output_file != stdout 
+       if (active_job->output_filename
+         && active_job->output_file != stdout 
          && ! active_job->external_surface) {
            fclose(active_job->output_file);
            active_job->output_file = NULL;
+            active_job->output_filename = NULL;
        }
-        active_job->output_filename = NULL;
        active_job = active_job->next_active;
     }
 }
index 92de373ea745b00f84efc38dd95cbc0a99986560..78fadd0417fb01bb2527643813b3199e0c77f688 100644 (file)
@@ -1269,6 +1269,7 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp,
        if (Tcl_GetOpenFile (interp, argv[2], 1, 1, &outfp) != TCL_OK)
            return TCL_ERROR;
        gvc->job->output_file = (FILE *)outfp;
+       gvc->job->output_filename = NULL;
 
        /* make sure that layout is done  - unless canonical output */
        if ((!GD_drawing(g) || argc > 4)