make pdf output work
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 11 Jun 2007 16:14:40 +0000 (16:14 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 11 Jun 2007 16:14:40 +0000 (16:14 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1109 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c
src/rrd_graph.h

index 6648d9c..4af6f82 100644 (file)
@@ -307,6 +307,7 @@ int im_free(
     image_desc_t *im)
 {
     unsigned long i, ii;
+    cairo_status_t status;
 
     if (im == NULL)
         return 0;
@@ -324,10 +325,19 @@ int im_free(
         free(im->gdes[i].rpnp);
     }
     free(im->gdes);
-    if (im->surface)
-        cairo_surface_destroy(im->surface);
     if (im->font_options)
         cairo_font_options_destroy(im->font_options);
+    
+    status = cairo_status (im->cr);
+
+    if (im->cr)
+        cairo_destroy(im->cr);
+    if (im->surface)
+        cairo_surface_destroy(im->surface);
+    if (status)
+        fprintf(stderr,"OOPS: Cairo has issuesm it can't even die: %s\n",
+                         cairo_status_to_string (status));
+
     return 0;
 }
 
index 502fefe..73c25d8 100644 (file)
@@ -5,6 +5,7 @@
 #define y1 cairo_y1
 #define index cairo_index
 
+#include <cairo.h>
 #include <cairo-pdf.h>
 #include <cairo-svg.h>
 #include <cairo-ps.h>