mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
OSX compatibility tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34861 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c7d0d1c1f5
commit
c8225e058b
2 changed files with 18 additions and 6 deletions
|
@ -1,4 +1,10 @@
|
||||||
2012-03-01 Richard Frith-Macdonald <rfm@gnu.org>
|
2012-03-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSURLConnection.m: Compatibility fix for bug #35686
|
||||||
|
In this case Cocoa breaks its own convention about delegates
|
||||||
|
not being retained, so we need to do the same.
|
||||||
|
|
||||||
|
2012-03-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Headers/GNUstepBase/config.h.in: add missing ICU headers
|
* Headers/GNUstepBase/config.h.in: add missing ICU headers
|
||||||
* Source/NSString.m: fix minor coding standard violations.
|
* Source/NSString.m: fix minor coding standard violations.
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
- (void) setConnection: (NSURLConnection*)c
|
- (void) setConnection: (NSURLConnection*)c
|
||||||
{
|
{
|
||||||
_connection = c;
|
_connection = c; // Not retained ... the connection retains us
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) connection: (NSURLConnection *)connection
|
- (void) connection: (NSURLConnection *)connection
|
||||||
|
@ -163,6 +163,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
[this->_protocol stopLoading];
|
[this->_protocol stopLoading];
|
||||||
DESTROY(this->_protocol);
|
DESTROY(this->_protocol);
|
||||||
|
DESTROY(this->_delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
@ -170,7 +171,8 @@ typedef struct
|
||||||
if (this != 0)
|
if (this != 0)
|
||||||
{
|
{
|
||||||
[self cancel];
|
[self cancel];
|
||||||
RELEASE(this->_request);
|
DESTROY(this->_request);
|
||||||
|
DESTROY(this->_delegate);
|
||||||
NSZoneFree([self zone], this);
|
NSZoneFree([self zone], this);
|
||||||
_NSURLConnectionInternal = 0;
|
_NSURLConnectionInternal = 0;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +218,11 @@ typedef struct
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->_delegate = delegate;
|
/* According to bug #35686, Cocoa has a bizarre deviation from the convention
|
||||||
|
* that delegates are not retained here. For compatibility we retain the
|
||||||
|
* delegate and release it aggain when the operation is over.
|
||||||
|
*/
|
||||||
|
this->_delegate = [delegate retain];
|
||||||
this->_protocol = [[NSURLProtocol alloc]
|
this->_protocol = [[NSURLProtocol alloc]
|
||||||
initWithRequest: this->_request
|
initWithRequest: this->_request
|
||||||
cachedResponse: nil
|
cachedResponse: nil
|
||||||
|
@ -309,8 +315,8 @@ typedef struct
|
||||||
NSRunLoop *loop;
|
NSRunLoop *loop;
|
||||||
|
|
||||||
collector = [_NSURLConnectionDataCollector new];
|
collector = [_NSURLConnectionDataCollector new];
|
||||||
conn = [self alloc];
|
conn = [[self alloc] initWithRequest: request delegate: collector];
|
||||||
conn = [conn initWithRequest: request delegate: [collector autorelease]];
|
[collector release]; // retained by connection
|
||||||
[collector setConnection: conn];
|
[collector setConnection: conn];
|
||||||
loop = [NSRunLoop currentRunLoop];
|
loop = [NSRunLoop currentRunLoop];
|
||||||
while ([collector done] == NO)
|
while ([collector done] == NO)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue