From 24bdf2ca796b675cd58e7ebd96103e6752559887 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Mon, 3 Oct 2011 12:35:32 -0400 Subject: [PATCH] Bug 686345 - Don't subtract from our count of canvas's memory if we never added to the count. r=jmuizelaar --- content/canvas/src/nsCanvasRenderingContext2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp index 51ed63c91e2..8281a80c946 100644 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp @@ -852,7 +852,7 @@ nsCanvasRenderingContext2D::Reset() // only do this for non-docshell created contexts, // since those are the ones that we created a surface for - if (mValid && !mDocShell) + if (mValid && !mDocShell && mSurface) gCanvasMemoryUsed -= mWidth * mHeight * 4; mSurface = nsnull;