44
55#import " flutter/shell/platform/darwin/ios/platform_message_handler_ios.h"
66
7- #import " flutter/fml/trace_event.h"
8- #import " flutter/lib/ui/window/platform_message.h"
9- #import " flutter/shell/platform/darwin/common/buffer_conversions.h"
10- #import " flutter/shell/platform/darwin/common/framework/Headers/FlutterBinaryMessenger.h"
7+ #include " flutter/fml/trace_event.h"
8+ #include " flutter/lib/ui/window/platform_message.h"
9+ #include " flutter/lib/ui/window/platform_message_response.h"
10+ #include " flutter/shell/platform/darwin/common/buffer_conversions.h"
11+
12+ FLUTTER_ASSERT_ARC
1113
1214static uint64_t platform_message_counter = 1 ;
1315
@@ -24,11 +26,6 @@ - (instancetype)init {
2426 return self;
2527}
2628
27- - (void )dealloc {
28- dispatch_release (_queue);
29- [super dealloc ];
30- }
31-
3229- (void )dispatch : (dispatch_block_t )block {
3330 dispatch_async (self.queue , block);
3431}
@@ -37,7 +34,7 @@ - (void)dispatch:(dispatch_block_t)block {
3734namespace flutter {
3835
3936NSObject <FlutterTaskQueue>* PlatformMessageHandlerIos::MakeBackgroundTaskQueue () {
40- return [[[ FLTSerialTaskQueue alloc ] init ] autorelease ];
37+ return [[FLTSerialTaskQueue alloc ] init ];
4138}
4239
4340PlatformMessageHandlerIos::PlatformMessageHandlerIos (
@@ -83,8 +80,8 @@ - (void)dispatch:(dispatch_block_t)block {
8380 });
8481 };
8582
86- if (handler_info.task_queue . get () ) {
87- [handler_info.task_queue. get () dispatch: run_handler];
83+ if (handler_info.task_queue ) {
84+ [handler_info.task_queue dispatch: run_handler];
8885 } else {
8986 dispatch_async (dispatch_get_main_queue (), run_handler);
9087 }
@@ -127,8 +124,7 @@ - (void)dispatch:(dispatch_block_t)block {
127124 message_handlers_.erase (channel);
128125 if (handler) {
129126 message_handlers_[channel] = {
130- .task_queue = fml::scoped_nsprotocol (
131- [static_cast<NSObject <FlutterTaskQueueDispatch>*>(task_queue) retain ]),
127+ .task_queue = (NSObject <FlutterTaskQueueDispatch>*)task_queue,
132128 .handler =
133129 fml::ScopedBlock<FlutterBinaryMessageHandler>{
134130 handler, fml::scoped_policy::OwnershipPolicy::kRetain },
0 commit comments