Skip to content

Commit

Permalink
strongSelf
Browse files Browse the repository at this point in the history
  • Loading branch information
jmagman committed Apr 13, 2024
1 parent ce974c6 commit 13eedc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

@property(nonatomic, strong, readonly) NSURL* url;
@property(nonatomic, readonly) NSURL* url;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,15 @@ - (instancetype)initWithEnableVMServicePublication:(BOOL)enableVMServicePublicat
[weakSelf, runner = fml::MessageLoop::GetCurrent().GetTaskRunner()](const std::string& uri) {
if (!uri.empty()) {
runner->PostTask([weakSelf, uri]() {
FlutterDartVMServicePublisher* strongSelf = weakSelf;
// uri comes in as something like 'http://127.0.0.1:XXXXX/' where XXXXX is the port
// number.
if (weakSelf) {
if (strongSelf) {
NSURL* url =
[[NSURL alloc] initWithString:[NSString stringWithUTF8String:uri.c_str()]];
weakSelf.url = url;
if (weakSelf.enableVMServicePublication) {
[[weakSelf delegate] publishServiceProtocolPort:url];
strongSelf.url = url;
if (strongSelf.enableVMServicePublication) {
[[strongSelf delegate] publishServiceProtocolPort:url];
}
}
});
Expand Down

0 comments on commit 13eedc5

Please sign in to comment.