]> granicus.if.org Git - graphviz/commitdiff
release gd surface between mutiple outputs
authorellson <devnull@localhost>
Mon, 26 Jun 2006 18:52:29 +0000 (18:52 +0000)
committerellson <devnull@localhost>
Mon, 26 Jun 2006 18:52:29 +0000 (18:52 +0000)
plugin/gd/gvrender_gd.c

index edf69d7170f917dfea3cce1e3dba413c18e4be9e..7d21699b03083a13e39ad04547b119dd512915a6 100644 (file)
@@ -89,7 +89,7 @@ static void gdgen_begin_page(GVJ_t * job)
     if (job->external_surface) {
        if (job->common->verbose)
            fprintf(stderr, "%s: using existing GD image\n", job->common->cmdname);
-       im = (gdImagePtr) (job->output_file);
+       im = (gdImagePtr) (job->surface);
     } else {
        if (truecolor_p) {
            if (job->common->verbose)
@@ -105,14 +105,11 @@ static void gdgen_begin_page(GVJ_t * job)
                        job->common->cmdname, ROUND(job->width * job->height / 1024.));
            im = gdImageCreate(job->width, job->height);
        }
+        job->surface = (void *) im;
     }
-    job->surface = (void *) im;
 
     if (!im) {
-#if 0
-/* FIXME - error function */
-       agerr(AGERR, "gdImageCreate returned NULL. Malloc problem?\n");
-#endif
+       job->common->errorfn("gdImageCreate returned NULL. Malloc problem?\n");
        return;
     }
 
@@ -230,6 +227,7 @@ static void gdgen_end_page(GVJ_t * job)
 #ifdef MYTRACE
        fprintf(stderr, "gdgen_end_graph (to file)\n");
 #endif
+       job->surface = NULL;
     }
 }