summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-01-21 12:04:45 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2015-01-26 06:30:38 +0100
commit367eb49cfd0bf5e04040951b23cfbbe84738fef1 (patch)
tree94e91c08556fedcb386a98516393ba6dd5428030
parent83a5436e1a97b908f3089c3c8ef51f604989ef69 (diff)
Fix memory leak in ImageDocument
An ImageLoader may hold a reference to its image element, and any element holds a guard on the document. To make the ImageLoader release the reference it needs to receive the notifyFinished() call, but that doesn't happen if the CachedResource is in the wrong state. The solution is to ensure we set the finish state on the resource before calling the method signifying loading is finished. Task-number: QTBUG-44023 Change-Id: I694483f6201b7ea4656016731e431f2806c3ab1c Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
-rw-r--r--Source/WebCore/html/ImageDocument.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/WebCore/html/ImageDocument.cpp b/Source/WebCore/html/ImageDocument.cpp
index 444bdb76a..7d9bcc589 100644
--- a/Source/WebCore/html/ImageDocument.cpp
+++ b/Source/WebCore/html/ImageDocument.cpp
@@ -152,8 +152,8 @@ void ImageDocumentParser::finish()
if (document()->frame()->loader()->documentLoader()->isLoadingMultipartContent())
data = data->copy();
- cachedImage->finishLoading(data.get());
cachedImage->finish();
+ cachedImage->finishLoading(data.get());
cachedImage->setResponse(document()->frame()->loader()->documentLoader()->response());