Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 32022df

Browse files
committed
strongSelf
1 parent bc99f1c commit 32022df

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

shell/platform/darwin/ios/framework/Source/FlutterDartVMServicePublisher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- (instancetype)init NS_UNAVAILABLE;
1515
+ (instancetype)new NS_UNAVAILABLE;
1616

17-
@property(nonatomic, strong, readonly) NSURL* url;
17+
@property(nonatomic, readonly) NSURL* url;
1818

1919
@end
2020

shell/platform/darwin/ios/framework/Source/FlutterDartVMServicePublisher.mm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,15 @@ - (instancetype)initWithEnableVMServicePublication:(BOOL)enableVMServicePublicat
157157
[weakSelf, runner = fml::MessageLoop::GetCurrent().GetTaskRunner()](const std::string& uri) {
158158
if (!uri.empty()) {
159159
runner->PostTask([weakSelf, uri]() {
160+
FlutterDartVMServicePublisher* strongSelf = weakSelf;
160161
// uri comes in as something like 'http://127.0.0.1:XXXXX/' where XXXXX is the port
161162
// number.
162-
if (weakSelf) {
163+
if (strongSelf) {
163164
NSURL* url =
164165
[[NSURL alloc] initWithString:[NSString stringWithUTF8String:uri.c_str()]];
165-
weakSelf.url = url;
166-
if (weakSelf.enableVMServicePublication) {
167-
[[weakSelf delegate] publishServiceProtocolPort:url];
166+
strongSelf.url = url;
167+
if (strongSelf.enableVMServicePublication) {
168+
[[strongSelf delegate] publishServiceProtocolPort:url];
168169
}
169170
}
170171
});

0 commit comments

Comments
 (0)