| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index cd1f453988f191fa7115e873f4c6e5fb25845c9b..8578ba3f6dcc803dbb80ba4c8e85d4babb34286c 100644
|
| --- a/Source/core/dom/Document.cpp
|
| +++ b/Source/core/dom/Document.cpp
|
| @@ -2207,9 +2207,11 @@ Document& Document::axObjectCacheOwner() const
|
| void Document::clearAXObjectCache()
|
| {
|
| ASSERT(&axObjectCacheOwner() == this);
|
| - // Clear the cache member variable before calling delete because attempts
|
| - // are made to access it during destruction.
|
| - m_axObjectCache.clear();
|
| + // Clear the cache member variable before calling discard because attempts
|
| + // are made to access it during discard.
|
| + OwnPtrWillBeRawPtr<AXObjectCache> cache = m_axObjectCache.release();
|
| + if (cache)
|
| + cache->dispose();
|
| }
|
|
|
| AXObjectCache* Document::existingAXObjectCache() const
|
| @@ -2240,7 +2242,7 @@ AXObjectCache* Document::axObjectCache() const
|
|
|
| ASSERT(&cacheOwner == this || !m_axObjectCache);
|
| if (!cacheOwner.m_axObjectCache)
|
| - cacheOwner.m_axObjectCache = adoptPtr(AXObjectCache::create(cacheOwner));
|
| + cacheOwner.m_axObjectCache = AXObjectCache::create(cacheOwner);
|
| return cacheOwner.m_axObjectCache.get();
|
| }
|
|
|
| @@ -5705,6 +5707,7 @@ DEFINE_TRACE(Document)
|
| visitor->trace(m_activeHoverElement);
|
| visitor->trace(m_documentElement);
|
| visitor->trace(m_titleElement);
|
| + visitor->trace(m_axObjectCache);
|
| visitor->trace(m_markers);
|
| visitor->trace(m_cssTarget);
|
| visitor->trace(m_currentScriptStack);
|
|
|