From 88d691c8690a245066a946195ffa7c6e94cd150e Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 19 Aug 1998 18:07:27 +0000 Subject: [PATCH] Re-ordered code that adds loader object to the array of loaders git-svn-id: svn://10.0.0.236/trunk@8194 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresContext.cpp | 3 ++- mozilla/layout/base/src/nsPresContext.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/base/nsPresContext.cpp b/mozilla/layout/base/nsPresContext.cpp index 45ae352ed5c..63bfcc75b93 100644 --- a/mozilla/layout/base/nsPresContext.cpp +++ b/mozilla/layout/base/nsPresContext.cpp @@ -423,15 +423,16 @@ nsPresContext::StartLoadImage(const nsString& aURL, if (NS_OK != rv) { return rv; } + mImageLoaders.AppendElement(loader); rv = loader->Init(this, mImageGroup, aURL, aBackgroundColor, aTargetFrame, aNeedSizeUpdate); if (NS_OK != rv) { + mImageLoaders.RemoveElement(loader); NS_RELEASE(loader); return rv; } // Return the loader - mImageLoaders.AppendElement(loader); NS_ADDREF(loader); aLoaderResult = loader; return NS_OK; diff --git a/mozilla/layout/base/src/nsPresContext.cpp b/mozilla/layout/base/src/nsPresContext.cpp index 45ae352ed5c..63bfcc75b93 100644 --- a/mozilla/layout/base/src/nsPresContext.cpp +++ b/mozilla/layout/base/src/nsPresContext.cpp @@ -423,15 +423,16 @@ nsPresContext::StartLoadImage(const nsString& aURL, if (NS_OK != rv) { return rv; } + mImageLoaders.AppendElement(loader); rv = loader->Init(this, mImageGroup, aURL, aBackgroundColor, aTargetFrame, aNeedSizeUpdate); if (NS_OK != rv) { + mImageLoaders.RemoveElement(loader); NS_RELEASE(loader); return rv; } // Return the loader - mImageLoaders.AppendElement(loader); NS_ADDREF(loader); aLoaderResult = loader; return NS_OK;