Commit f56c4413 authored by hyatt's avatar hyatt
Browse files

Add asserts to help catch double refs and double derefs of CachedResources.

        Reviewed by mjs

        * loader/CachedResource.cpp:
        (WebCore::CachedResource::ref):
        (WebCore::CachedResource::deref):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3163197d
2007-03-14 David Hyatt <hyatt@apple.com>
Add asserts to help catch double refs and double derefs of CachedResources.
Reviewed by mjs
* loader/CachedResource.cpp:
(WebCore::CachedResource::ref):
(WebCore::CachedResource::deref):
2007-03-14 Alice Liu <alice.liu@apple.com>
 
Rubber-stamped by Hyatt.
......
......@@ -94,6 +94,7 @@ void CachedResource::setRequest(Request* request)
void CachedResource::ref(CachedResourceClient *c)
{
ASSERT(!m_clients.contains(c));
if (!referenced() && inCache())
cache()->addToLiveObjectSize(size());
m_clients.add(c);
......@@ -101,6 +102,7 @@ void CachedResource::ref(CachedResourceClient *c)
void CachedResource::deref(CachedResourceClient *c)
{
ASSERT(m_clients.contains(c));
m_clients.remove(c);
if (canDelete() && !inCache())
delete this;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment