Changeset 143282 in webkit


Ignore:
Timestamp:
Feb 18, 2013 5:55:58 PM (11 years ago)
Author:
mark.lam@apple.com
Message:

Small follow up to r143271: Fix SQLTransaction leak.
https://bugs.webkit.org/show_bug.cgi?id=110052.

Reviewed by Geoffrey Garen.

Applied Geoff's suggestion nullify m_frontend sooner for greater
code clarity. Also added some comments about m_frontend.

No new tests.

  • Modules/webdatabase/SQLTransactionBackend.cpp:

(WebCore::SQLTransactionBackend::doCleanup):

  • Modules/webdatabase/SQLTransactionBackend.h:

(SQLTransactionBackend):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143279 r143282  
     12013-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
    1182013-02-18  Geoffrey Garen  <ggaren@apple.com>
    219
  • trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp

    r143271 r143282  
    243243//     Note: there's a circular reference between the SQLTransaction front-end and
    244244//     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.
    248250//
    249251//     After scheduling the transaction with the DatabaseThread (DatabaseBackendAsync::scheduleTransaction()):
     
    381383    if (!m_frontend)
    382384        return;
     385    m_frontend = 0; // Break the reference cycle. See comment about the life-cycle above.
    383386
    384387    ASSERT(currentThread() == database()->databaseContext()->databaseThread()->getThreadID());
     
    399402    if (m_lockAcquired)
    400403        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;
    405404
    406405    // Do some aggresive clean up here except for m_database.
  • trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h

    r143264 r143282  
    110110    void getNextStatement();
    111111
    112     RefPtr<SQLTransaction> m_frontend;
     112    RefPtr<SQLTransaction> m_frontend; // Has a reference cycle, and will break in doCleanup().
    113113    RefPtr<SQLStatementBackend> m_currentStatementBackend;
    114114
Note: See TracChangeset for help on using the changeset viewer.