-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate FlutterDartProject and FlutterPluginAppLifeCycleDelegate to ARC #52719
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,10 @@ | |
#include "flutter/fml/logging.h" | ||
#include "flutter/fml/paths.h" | ||
#include "flutter/lib/ui/plugins/callback_cache.h" | ||
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" | ||
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache_Internal.h" | ||
|
||
FLUTTER_ASSERT_ARC | ||
|
||
static const char* kCallbackCacheSubDir = "Library/Caches/"; | ||
|
||
static const SEL kSelectorsHandledByPlugins[] = { | ||
|
@@ -43,7 +44,7 @@ - (void)addObserverFor:(NSString*)name selector:(SEL)selector { | |
dispatch_block_t unsubscribe = ^{ | ||
[[NSNotificationCenter defaultCenter] removeObserver:blockSelf name:name object:nil]; | ||
}; | ||
[_notificationUnsubscribers addObject:[[unsubscribe copy] autorelease]]; | ||
[_notificationUnsubscribers addObject:[unsubscribe copy]]; | ||
} | ||
|
||
- (instancetype)init { | ||
|
@@ -63,7 +64,7 @@ - (instancetype)init { | |
[self addObserverFor:UIApplicationWillTerminateNotification | ||
selector:@selector(handleWillTerminate:)]; | ||
#endif | ||
_delegates = [[NSPointerArray weakObjectsPointerArray] retain]; | ||
_delegates = [NSPointerArray weakObjectsPointerArray]; | ||
_debugBackgroundTask = UIBackgroundTaskInvalid; | ||
} | ||
return self; | ||
|
@@ -73,9 +74,6 @@ - (void)dealloc { | |
for (dispatch_block_t unsubscribe in _notificationUnsubscribers) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can delete this code, all of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to do all the unsubscribes separately, I didn't have a chance to put it out for review yet, it's waiting for this PR to merge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
unsubscribe(); | ||
} | ||
[_notificationUnsubscribers release]; | ||
[_delegates release]; | ||
[super dealloc]; | ||
} | ||
|
||
static BOOL IsPowerOfTwo(NSUInteger x) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused.