Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: Source/WebCore/storage/IDBCursorBackendImpl.cpp

Issue 9121008: Merge 104252 - Source/WebCore: IndexedDB: fix cursor prefetch crash (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/storage/IDBCursorBackendImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/storage/IDBCursorBackendImpl.cpp
===================================================================
--- Source/WebCore/storage/IDBCursorBackendImpl.cpp (revision 104309)
+++ Source/WebCore/storage/IDBCursorBackendImpl.cpp (working copy)
@@ -47,6 +47,7 @@
, m_cursorType(cursorType)
, m_transaction(transaction)
, m_objectStore(objectStore)
+ , m_closed(false)
{
m_transaction->registerOpenCursor(this);
}
@@ -54,6 +55,11 @@
IDBCursorBackendImpl::~IDBCursorBackendImpl()
{
m_transaction->unregisterOpenCursor(this);
+ // Order is important, the cursors have to be destructed before the objectStore.
+ m_cursor.clear();
+ m_savedCursor.clear();
+
+ m_objectStore.clear();
}
unsigned short IDBCursorBackendImpl::direction() const
@@ -174,6 +180,8 @@
m_cursor = m_savedCursor;
m_savedCursor = 0;
+ if (m_closed)
+ return;
if (m_cursor) {
for (int i = 0; i < usedPrefetches; ++i) {
bool ok = m_cursor->continueFunction();
@@ -184,6 +192,7 @@
void IDBCursorBackendImpl::close()
{
+ m_closed = true;
if (m_cursor)
m_cursor->close();
}
« no previous file with comments | « Source/WebCore/storage/IDBCursorBackendImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698