Copy string fix

pull/16190/head
Muxi Yan 6 years ago
parent 50dac67214
commit 161dc27b2d
  1. 6
      src/objective-c/GRPCClient/GRPCCall.m

@ -68,8 +68,8 @@ const char *kCFStreamVarName = "grpc_cfstream";
- (instancetype)initWithHost:(NSString *)host path:(NSString *)path safety:(GRPCCallSafety)safety { - (instancetype)initWithHost:(NSString *)host path:(NSString *)path safety:(GRPCCallSafety)safety {
if ((self = [super init])) { if ((self = [super init])) {
_host = host; _host = [host copy];
_path = path; _path = [path copy];
_safety = safety; _safety = safety;
} }
return self; return self;
@ -77,7 +77,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
- (id)copyWithZone:(NSZone *)zone { - (id)copyWithZone:(NSZone *)zone {
GRPCRequestOptions *request = GRPCRequestOptions *request =
[[GRPCRequestOptions alloc] initWithHost:[_host copy] path:[_path copy] safety:_safety]; [[GRPCRequestOptions alloc] initWithHost:_host path:_path safety:_safety];
return request; return request;
} }

Loading…
Cancel
Save