diff options
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCWrappedCall.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCWrappedCall.m | 20 |
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{ |