From b4a900ee542513df69217adfb7b75975f2863376 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Fri, 27 Jan 2006 01:11:50 +0000 Subject: [PATCH] Fix bug 323028 -- don't set our mRequest until after the clone is done. r+sr=dbaron --- layout/base/nsImageLoader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layout/base/nsImageLoader.cpp b/layout/base/nsImageLoader.cpp index c1f27a1d3543..da4c70a987a2 100644 --- a/layout/base/nsImageLoader.cpp +++ b/layout/base/nsImageLoader.cpp @@ -123,7 +123,13 @@ nsImageLoader::Load(imgIRequest *aImage) mRequest = nsnull; } - return aImage->Clone(this, getter_AddRefs(mRequest)); + // Make sure to clone into a temporary, then set mRequest, since + // cloning may notify and we don't want to trigger paints from this + // code. + nsCOMPtr newRequest; + nsresult rv = aImage->Clone(this, getter_AddRefs(newRequest)); + mRequest.swap(newRequest); + return rv; }