From ad23a889c5eeea44fb0f205d9b080314a35939c6 Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Tue, 9 Oct 2007 23:17:41 +0000 Subject: [PATCH] Bug 398926 - nsWeakReference leak with stroke and fill using the same pattern. r+sr+a=roc git-svn-id: svn://10.0.0.236/trunk@237493 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/svg/content/src/nsSVGValue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mozilla/content/svg/content/src/nsSVGValue.cpp b/mozilla/content/svg/content/src/nsSVGValue.cpp index 2b5097a73c1..ea235ea00bf 100644 --- a/mozilla/content/svg/content/src/nsSVGValue.cpp +++ b/mozilla/content/svg/content/src/nsSVGValue.cpp @@ -108,8 +108,10 @@ nsSVGValue::AddObserver(nsISVGValueObserver* observer) // stroke and fill. Safe, as on a style change we remove both, as // the change notification isn't fine grained, and re-add as // appropriate. - if (mObservers.IndexOf((void*)wr) >= 0) + if (mObservers.IndexOf((void*)wr) >= 0) { + NS_RELEASE(wr); return NS_OK; + } mObservers.AppendElement((void*)wr); return NS_OK;