From 0ad1a9aeaa61c867a39d9bce774191230bfb335b Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 11 Mar 2011 13:22:55 -0800 Subject: [PATCH] Apply refactored patch from Olaf to free Context2d states --- src/CanvasRenderingContext2d.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index 279ca47..f70d0a4 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -139,6 +139,10 @@ Context2d::Context2d(Canvas *canvas) { */ Context2d::~Context2d() { + // Olaf (2011-02-21): free the state table + for (int i = 0 ; i < CANVAS_MAX_STATES; ++i) { + if (states[i]) free(states[i]); + } cairo_destroy(_context); }