Moved deallocation code to the right place

pull/1363/head
murgatroid99 10 years ago
parent fe2c0c6569
commit 33655f970b
  1. 20
      src/objective-c/GRPCClient/private/GRPCWrappedCall.m

@ -68,13 +68,16 @@
- (void (^)(void))opProcessor {
return ^{
gpr_free(_send_metadata);
if (_handler) {
_handler();
}
};
}
- (void)dealloc {
gpr_free(_send_metadata);
}
@end
@implementation GRPCOpSendMessage{
@ -104,13 +107,16 @@
- (void (^)(void))opProcessor {
return ^{
gpr_free(_byte_buffer);
if (_handler) {
_handler();
}
};
}
- (void)dealloc {
gpr_free(_byte_buffer);
}
@end
@implementation GRPCOpSendClose{
@ -169,13 +175,16 @@
NSDictionary *metadata = [NSDictionary
grpc_dictionaryFromMetadata:_recv_initial_metadata.metadata
count:_recv_initial_metadata.count];
grpc_metadata_array_destroy(&_recv_initial_metadata);
if (_handler) {
_handler(metadata);
}
};
}
- (void)dealloc {
grpc_metadata_array_destroy(&_recv_initial_metadata);
}
@end
@implementation GRPCOpRecvMessage{
@ -241,12 +250,15 @@
return ^{
if (_handler) {
NSError *error = [NSError grpc_errorFromStatus:&_status];
grpc_metadata_array_destroy(&_status.metadata);
_handler(error);
}
};
}
- (void)dealloc {
grpc_metadata_array_destroy(&_status.metadata);
}
@end
@implementation GRPCWrappedCall{

Loading…
Cancel
Save