This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
shell/platform/darwin/ios Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 66#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_PLATFORM_MESSAGE_HANDLER_IOS_H_
77
88#include " flutter/fml/platform/darwin/scoped_block.h"
9+ #include " flutter/fml/platform/darwin/scoped_nsobject.h"
910#include " flutter/fml/task_runner.h"
1011#include " flutter/shell/common/platform_message_handler.h"
1112#import " flutter/shell/platform/darwin/ios/flutter_task_queue_dispatch.h"
@@ -32,7 +33,7 @@ class PlatformMessageHandlerIos : public PlatformMessageHandler {
3233 NSObject <FlutterTaskQueue>* task_queue);
3334
3435 struct HandlerInfo {
35- NSObject <FlutterTaskQueueDispatch>* task_queue;
36+ fml::scoped_nsprotocol< NSObject <FlutterTaskQueueDispatch>*> task_queue;
3637 fml::ScopedBlock<FlutterBinaryMessageHandler> handler;
3738 };
3839
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ - (void)dispatch:(dispatch_block_t)block {
8080 });
8181 };
8282
83- if (handler_info.task_queue ) {
84- [handler_info.task_queue dispatch: run_handler];
83+ if (handler_info.task_queue . get () ) {
84+ [handler_info.task_queue. get () dispatch: run_handler];
8585 } else {
8686 dispatch_async (dispatch_get_main_queue (), run_handler);
8787 }
@@ -124,7 +124,8 @@ - (void)dispatch:(dispatch_block_t)block {
124124 message_handlers_.erase (channel);
125125 if (handler) {
126126 message_handlers_[channel] = {
127- .task_queue = (NSObject <FlutterTaskQueueDispatch>*)task_queue,
127+ .task_queue =
128+ fml::scoped_nsprotocol (static_cast <NSObject <FlutterTaskQueueDispatch>*>(task_queue)),
128129 .handler =
129130 fml::ScopedBlock<FlutterBinaryMessageHandler>{
130131 handler, fml::scoped_policy::OwnershipPolicy::kRetain },
You can’t perform that action at this time.
0 commit comments