@@ -39,7 +39,6 @@ - (BenoniHTTPTaskContextWrap *)initWithContext:
39
39
40
40
- (void )dealloc {
41
41
delete context;
42
- [super dealloc ];
43
42
}
44
43
@end
45
44
@@ -123,7 +122,7 @@ - (void)URLSession:(NSURLSession *)session
123
122
HTTPTaskContext *context = [contextWrap context ];
124
123
125
124
if (context->data == nil ) {
126
- context->data = [[ NSMutableData data ] retain ];
125
+ context->data = [NSMutableData data ];
127
126
}
128
127
129
128
[context->data appendData: data];
@@ -140,7 +139,7 @@ - (void)URLSession:(NSURLSession *)session
140
139
141
140
if (error) {
142
141
std::string error_string ([[error localizedDescription ] UTF8String ]);
143
- [contextWrap dealloc ] ;
142
+ contextMap_[key] = nil ;
144
143
callback (std::move (error_string));
145
144
return ;
146
145
}
@@ -159,11 +158,11 @@ - (void)URLSession:(NSURLSession *)session
159
158
}
160
159
[responseString appendString: chunk];
161
160
}];
162
- [ context->data release ] ;
161
+ context->data = nil ;
163
162
164
163
if (success == NO ) {
165
164
std::string error_string (" response body has invalid encoding" );
166
- [contextWrap dealloc ] ;
165
+ contextMap_[key] = nil ;
167
166
callback (std::move (error_string));
168
167
return ;
169
168
}
@@ -175,7 +174,7 @@ - (void)URLSession:(NSURLSession *)session
175
174
.status = context->status ,
176
175
.headers = std::move (context->headers ),
177
176
};
178
- [contextWrap dealloc ] ;
177
+ contextMap_[key] = nil ;
179
178
callback (response);
180
179
}
181
180
@end
0 commit comments