Changeset 24875 in webkit


Ignore:
Timestamp:
Aug 5, 2007, 3:52:19 AM (18 years ago)
Author:
mjs
Message:

Reviewed by Darin Adler.


<rdar://problem/5369110> CrashTracer: [USER] reproducible crash opening particular mail messages

  • platform/network/mac/ResourceHandleMac.mm: (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): Make sure to retain self for the body of this method. Otherwise, the willSendRequest could trigger events which will cancel the connection, and we access ivars after this point. (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]): retain and release in the right order.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r24872 r24875  
     12007-08-05  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Darin Adler.
     4       
     5        <rdar://problem/5369110> CrashTracer: [USER] reproducible crash opening particular mail messages
     6
     7        * platform/network/mac/ResourceHandleMac.mm:
     8        (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): Make sure to retain
     9        self for the body of this method. Otherwise, the willSendRequest could trigger events which will
     10        cancel the connection, and we access ivars after this point.
     11        (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]): retain and release
     12        in the right order.
     13
    1142007-08-04  Adam Roben  <aroben@apple.com>
    215
  • trunk/WebCore/platform/network/mac/ResourceHandleMac.mm

    r24779 r24875  
    346346- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
    347347{
     348    // the willSendRequest call may cancel this load, in which case self could be deallocated
     349    RetainPtr<WebCoreResourceHandleAsDelegate> protect(self);
     350
    348351    if (!m_handle || !m_handle->client())
    349352        return nil;
     
    353356    --inNSURLConnectionCallback;
    354357#ifndef BUILDING_ON_TIGER
     358    NSURL *copy = [[request.nsURLRequest() URL] copy];
    355359    [m_url release];
    356     m_url = [[request.nsURLRequest() URL] copy];   
     360    m_url = copy;
    357361#endif
    358362   
     
    515519- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
    516520{
     521    NSURL *copy = [[newRequest URL] copy];
    517522    [m_url release];
    518     m_url = [[newRequest URL] copy];
     523    m_url = copy;
    519524
    520525    return newRequest;
Note: See TracChangeset for help on using the changeset viewer.