From 3388ab5b33a5539d18b825ac494ff97d9daf070b Mon Sep 17 00:00:00 2001 From: c-spencer Date: Fri, 10 Aug 2012 12:16:11 +0100 Subject: [PATCH] Properly dispose of pango related allocations in ~Context2d() --- src/CanvasRenderingContext2d.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index a3ceaa6..53078b1 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -178,7 +178,15 @@ Context2d::Context2d(Canvas *canvas) { */ Context2d::~Context2d() { - while(stateno >= 0) free(states[stateno--]); + while(stateno >= 0) { +#if HAVE_PANGO + free(states[stateno]->fontFamily); +#endif + free(states[stateno--]); + } +#if HAVE_PANGO + g_object_unref(_layout); +#endif cairo_destroy(_context); }