aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-04-29 11:15:35 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-04-29 11:15:35 -0700
commit33655f970ba6c0b5a55306081ee2cf4143ddd746 (patch)
treee467b131e443821263a57c72cd265edf74bcc837 /src/objective-c/GRPCClient
parentfe2c0c6569fd40bc5f8c75a97495770bd0da1f4b (diff)
Moved deallocation code to the right place
Diffstat (limited to 'src/objective-c/GRPCClient')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCWrappedCall.m20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
index 312a6832d2..e3ccf45ea2 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+++ b/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{