| Index: Source/modules/indexeddb/IDBCursor.cpp
|
| diff --git a/Source/modules/indexeddb/IDBCursor.cpp b/Source/modules/indexeddb/IDBCursor.cpp
|
| index bcf7bb7f74961946b5ece8b6f4a0db1d7f8034f4..68a346ca75a2dabf7ff02da0b1547b62853ca9c7 100644
|
| --- a/Source/modules/indexeddb/IDBCursor.cpp
|
| +++ b/Source/modules/indexeddb/IDBCursor.cpp
|
| @@ -80,7 +80,6 @@ IDBCursor::IDBCursor(PassRefPtr<IDBCursorBackendInterface> backend, IndexedDB::C
|
| , m_direction(direction)
|
| , m_source(source)
|
| , m_transaction(transaction)
|
| - , m_transactionNotifier(transaction, this)
|
| , m_gotValue(false)
|
| , m_keyDirty(true)
|
| , m_primaryKeyDirty(true)
|
| @@ -274,14 +273,23 @@ void IDBCursor::close()
|
| {
|
| // The notifier may be the last reference to this cursor.
|
| RefPtr<IDBCursor> protect(this);
|
| - m_transactionNotifier.cursorFinished();
|
| - if (m_request) {
|
| - m_request->finishCursor();
|
| - m_request.clear();
|
| - }
|
| + m_request.clear();
|
| m_backend.clear();
|
| }
|
|
|
| +void IDBCursor::checkForReferenceCycle()
|
| +{
|
| + // If this cursor and its request have the only references
|
| + // to each other, then explicitly break the cycle.
|
| + if (!m_request || m_request->getResultCursor() != this)
|
| + return;
|
| +
|
| + if (!hasOneRef() || !m_request->hasOneRef())
|
| + return;
|
| +
|
| + m_request.clear();
|
| +}
|
| +
|
| ScriptValue IDBCursor::key(ScriptExecutionContext* context)
|
| {
|
| m_keyDirty = false;
|
|
|