diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-03-21 22:19:43 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-03-21 22:19:43 +0100 |
commit | 702243698cf6f56750426ca252e24951f46a5d4c (patch) | |
tree | 127205f4514eab42ae086234e871e20870483c2f /src/objective-c/GRPCClient/private/GRPCWrappedCall.m | |
parent | fb6e13b1b5ba135220c7be1edf3fb6f92e79872b (diff) |
For GRPCOperation's, ensure finish _handler can only be called once, and release it when called, so weak ptrs needn't be used with it, and the call won't be released until the finish handler is called.
When the connectivityMonitor determines the connection has been lost, pull the host disconnect call. Creates an unreliable connection when connectivity is restored. Calling finishWithError: is sufficient.
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCWrappedCall.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCWrappedCall.m | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index fe3d51da53..16e5bff7ff 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -54,7 +54,9 @@ - (void)finish { if (_handler) { - _handler(); + void(^handler)() = _handler; + _handler = nil; + handler(); } } @end |