Fix [NSURLProtocol -initWithRequest:cachedResponse:client:] to retain the client (up until the last message is sent to it) as OSX does.

This commit is contained in:
Richard Frith-Macdonald 2020-04-13 08:53:02 +01:00
parent df1b6dd6d5
commit ccb8594bc0
3 changed files with 11 additions and 2 deletions

View file

@ -373,7 +373,7 @@ typedef struct {
NSInputStream *input;
NSOutputStream *output;
NSCachedURLResponse *cachedResponse;
id <NSURLProtocolClient> client; // Not retained
id <NSURLProtocolClient> client;
NSURLRequest *request;
NSString *in;
NSString *out;
@ -526,6 +526,7 @@ static NSURLProtocol *placeholder = nil;
}
DESTROY(this->cachedResponse);
DESTROY(this->request);
DESTROY(this->client);
#if USE_ZLIB
if (this->compressing == YES)
{