Fixes leak of url in FlutterObservatoryPublisher (flutter/engine#14822)

This commit is contained in:
Wu Zhong 2020-01-10 10:08:03 +08:00 committed by Flutter GitHub Bot
parent 3b09b3866a
commit 06b81e9f3a

View File

@ -91,7 +91,7 @@
- (void)publishServiceProtocolPort:(NSString*)uri {
// uri comes in as something like 'http://127.0.0.1:XXXXX/' where XXXXX is the port
// number.
url.reset([[[NSURL alloc] initWithString:uri] retain]);
url.reset([[NSURL alloc] initWithString:uri]);
DNSServiceFlags flags = kDNSServiceFlagsDefault;
#if TARGET_IPHONE_SIMULATOR
@ -157,7 +157,7 @@ static void DNSSD_API registrationCallback(DNSServiceRef sdRef,
- (void)publishServiceProtocolPort:(NSString*)uri {
// uri comes in as something like 'http://127.0.0.1:XXXXX/' where XXXXX is the port
// number.
url.reset([[[NSURL alloc] initWithString:uri] retain]);
url.reset([[NSURL alloc] initWithString:uri]);
NSNetService* netServiceTmp = [[NSNetService alloc] initWithDomain:@"local."
type:@"_dartobservatory._tcp."