JDjimenezdelgado / wtclient

Automatically exported from code.google.com/p/wtclient
0 stars 0 forks source link

Crash when deallocating WTClient #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I observe a crash sometimes at the end of an upload. After investigation, it 
seems to be caused by a missing setter in WTClient.m, where the authentication 
is not retained when it should be. Here is a proposed setter:

- (void)setAuthentication:(CFHTTPAuthenticationRef)auth
{
    if(auth != authentication)
    {
        if(authentication) CFRelease(authentication);
        authentication = auth;
        if(authentication) CFRetain(authentication);
    }
}

Thread 3 Crashed:
0   libobjc.A.dylib                 0x02820a63 objc_msgSend + 23
1   CFNetwork                       0x01be9534 HTTPMessage::~HTTPMessage() + 160
2   CoreFoundation                  0x025d5bcb _CFRelease + 251
3   CFNetwork                       0x01c0eefe HTTPReadStream::~HTTPReadStream() 
+ 100
4   CoreFoundation                  0x025d5bcb _CFRelease + 251
5   CoreFoundation                  0x025f969c __CFStreamDeallocate + 204
6   CoreFoundation                  0x025d5bcb _CFRelease + 251
7   MyApp                           0x00246edf -[WTHTTPConnection dealloc] + 541 
(WTHTTPConnection.m:301)
8   MyApp                           0x002452e0 -[WTClient dealloc] + 457 
(WTClient.m:276)
9   Foundation                      0x00f612b7 __NSFinalizeThreadData + 1220
10  libSystem.B.dylib               0x94de4289 _pthread_tsd_cleanup + 190
11  libSystem.B.dylib               0x94de3e36 _pthread_exit + 154
12  Foundation                      0x00f6ad72 -[NSString compare:options:] + 0
13  Foundation                      0x00f6acf0 __NSThread__main__ + 1411
14  libSystem.B.dylib               0x94ddb85d _pthread_start + 345
15  libSystem.B.dylib               0x94ddb6e2 thread_start + 34

Original issue reported on code.google.com by raphael....@gmail.com on 25 Nov 2010 at 9:04