Changeset 29515 in webkit


Ignore:
Timestamp:
Jan 16, 2008 1:38:40 AM (16 years ago)
Author:
Simon Hausmann
Message:

Fix crashes in the new networking code.

When the ResourceLoader cancels the handle we have to make sure not to access
the resource handle afterwards again.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r29514 r29515  
     12008-01-16  Simon Hausmann  <hausmann@webkit.org>
     2
     3        Reviewed by Lars Knoll <lars@trolltech.com>.
     4
     5        Fix crashes in the new networking code.
     6
     7        When the ResourceLoader cancels the handle we have to make sure not to access
     8        the resource handle afterwards again.
     9
     10        * platform/network/qt/QNetworkReplyHandler.cpp:
     11        (WebCore::QNetworkReplyHandler::finish):
     12        (WebCore::QNetworkReplyHandler::forwardData):
     13
    1142008-01-16  Lars Knoll  <lars@trolltech.com>
    215
  • trunk/WebCore/platform/network/qt/QNetworkReplyHandler.cpp

    r29514 r29515  
    6767void QNetworkReplyHandler::abort()
    6868{
     69    m_resourceHandle = 0;
    6970    if (m_reply) {
    7071        disconnect(m_reply, 0, this, 0);
     
    7879    sendResponseIfNeeded();
    7980
     81    if (!m_resourceHandle)
     82        return;
    8083    ResourceHandleClient* client = m_resourceHandle->client();
    8184    m_reply->deleteLater();
     
    97100void QNetworkReplyHandler::sendResponseIfNeeded()
    98101{
    99     if (m_responseSent)
     102    if (m_responseSent || !m_resourceHandle)
    100103        return;
    101104    m_responseSent = true;
     
    164167        return;
    165168
     169    if (!m_resourceHandle)
     170        return;
     171
    166172    QByteArray data = m_reply->read(m_reply->bytesAvailable());
    167173
Note: See TracChangeset for help on using the changeset viewer.