Prevent decoded images from being destroyed when they're in use.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Sep 2014 15:54:26 +0000 (15:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Sep 2014 15:54:26 +0000 (15:54 +0000)
commit1cb3f96673b303c2288dd5cdc98af16d09f85000
treed333cba3cbb1dfb5cd7fa8744f16a74161d30609
parent63b88cfae23161ae085fd76e75bdcbad3b8e5378
Prevent decoded images from being destroyed when they're in use.
https://bugs.webkit.org/show_bug.cgi?id=136259.

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2014-09-02
Reviewed by Darin Adler.

Try to fix a regression introduced by r172790. Before the patch,
CachedImage does not release its Image object if it still has clients.
However this behavior was changed due to removal of CachedResource::isSafeToMakePurgeable(),
which implied a call to CachedResource::hasClients(). This patch restores
the behavior by adding a check to hasClients() in CachedImage::destroyDecodedData().

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::destroyDecodedData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedImage.cpp