Permalink
Browse files

Call cairo_surface_finish in ~Canvas when pdf

Fixes an issue where when a pdf surface isn't buffered and then is
garbage collected, the toBuffer can be called and attempt to realloc
the destroyed closure.
  • Loading branch information...
1 parent 0d39dae commit cfc6dfd714772af87e814a687230ae16b4690182 @c-spencer c-spencer committed Dec 19, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Canvas.cc
View
@@ -1,4 +1,3 @@
-
//
// Canvas.cc
//
@@ -406,6 +405,7 @@ Canvas::Canvas(int w, int h, canvas_type_t t): ObjectWrap() {
Canvas::~Canvas() {
switch (type) {
case CANVAS_TYPE_PDF:
+ cairo_surface_finish(_surface);
closure_destroy((closure_t *) _closure);
free(_closure);
cairo_surface_destroy(_surface);

0 comments on commit cfc6dfd

Please sign in to comment.