From 7c247a907f43b7c645c6e878418ab074f0042cf5 Mon Sep 17 00:00:00 2001 From: "longsonr%gmail.com" Date: Mon, 23 Jul 2007 08:54:52 +0000 Subject: [PATCH] Bug 388385 - Memory leak with SVG patterns and clipPaths. r+sr=vladimir --- gfx/thebes/src/gfxContext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/thebes/src/gfxContext.cpp b/gfx/thebes/src/gfxContext.cpp index 73110a41a69..9254c432168 100644 --- a/gfx/thebes/src/gfxContext.cpp +++ b/gfx/thebes/src/gfxContext.cpp @@ -643,7 +643,7 @@ gfxContext::GetPattern() else wrapper = new gfxPattern(gfxRGBA(0,0,0,0)); - NS_ADDREF(wrapper); + NS_IF_ADDREF(wrapper); return wrapper; } @@ -681,7 +681,8 @@ gfxContext::PopGroup() { cairo_pattern_t *pat = cairo_pop_group(mCairo); gfxPattern *wrapper = new gfxPattern(pat); - NS_ADDREF(wrapper); + cairo_pattern_destroy(pat); + NS_IF_ADDREF(wrapper); return wrapper; }