Changeset 143282 in webkit
- Timestamp:
- Feb 18, 2013 5:55:58 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143279 r143282 1 2013-02-18 Mark Lam <mark.lam@apple.com> 2 3 Small follow up to r143271: Fix SQLTransaction leak. 4 https://bugs.webkit.org/show_bug.cgi?id=110052. 5 6 Reviewed by Geoffrey Garen. 7 8 Applied Geoff's suggestion nullify m_frontend sooner for greater 9 code clarity. Also added some comments about m_frontend. 10 11 No new tests. 12 13 * Modules/webdatabase/SQLTransactionBackend.cpp: 14 (WebCore::SQLTransactionBackend::doCleanup): 15 * Modules/webdatabase/SQLTransactionBackend.h: 16 (SQLTransactionBackend): 17 1 18 2013-02-18 Geoffrey Garen <ggaren@apple.com> 2 19 -
trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
r143271 r143282 243 243 // Note: there's a circular reference between the SQLTransaction front-end and 244 244 // back-end. This circular reference is established in the constructor of the 245 // SQLTransactionBackend. The circular reference will only be broken at the end 246 // of the transaction's clean up state i.e. when the transaction should no 247 // longer be in use thereafter. 245 // SQLTransactionBackend. The circular reference will be broken by calling 246 // doCleanup() to nullify m_frontend. This is done at the end of the transaction's 247 // clean up state (i.e. when the transaction should no longer be in use thereafter), 248 // or if the database was interrupted. See comments on "What happens if a transaction 249 // is interrupted?" below for details. 248 250 // 249 251 // After scheduling the transaction with the DatabaseThread (DatabaseBackendAsync::scheduleTransaction()): … … 381 383 if (!m_frontend) 382 384 return; 385 m_frontend = 0; // Break the reference cycle. See comment about the life-cycle above. 383 386 384 387 ASSERT(currentThread() == database()->databaseContext()->databaseThread()->getThreadID()); … … 399 402 if (m_lockAcquired) 400 403 m_database->transactionCoordinator()->releaseLock(this); 401 402 // Now that we're done, break the reference cycle that keeps us alive.403 // See comment about the life-cycle above.404 m_frontend = 0;405 404 406 405 // Do some aggresive clean up here except for m_database. -
trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h
r143264 r143282 110 110 void getNextStatement(); 111 111 112 RefPtr<SQLTransaction> m_frontend; 112 RefPtr<SQLTransaction> m_frontend; // Has a reference cycle, and will break in doCleanup(). 113 113 RefPtr<SQLStatementBackend> m_currentStatementBackend; 114 114
Note: See TracChangeset
for help on using the changeset viewer.