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

Commit 47254ff

Browse files
committed
copies
1 parent cfbd14e commit 47254ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ @implementation FlutterKeyCallbackGuard {
316316
- (nonnull instancetype)initWithCallback:(FlutterAsyncKeyCallback)callback {
317317
self = [super init];
318318
if (self != nil) {
319-
_callback = callback;
319+
_callback = [callback copy];
320320
_handled = FALSE;
321321
}
322322
return self;
@@ -354,15 +354,15 @@ @interface FlutterEmbedderKeyResponder ()
354354
*
355355
* Set by the initializer.
356356
*/
357-
@property(nonatomic, readonly) FlutterSendKeyEvent sendEvent;
357+
@property(nonatomic, copy, readonly) FlutterSendKeyEvent sendEvent;
358358

359359
/**
360360
* A map of pressed keys.
361361
*
362362
* The keys of the dictionary are physical keys, while the values are the logical keys
363363
* of the key down event.
364364
*/
365-
@property(nonatomic, readonly) NSMutableDictionary<NSNumber*, NSNumber*>* pressingRecords;
365+
@property(nonatomic, copy, readonly) NSMutableDictionary<NSNumber*, NSNumber*>* pressingRecords;
366366

367367
/**
368368
* A constant mask for NSEvent.modifierFlags that Flutter synchronizes with.
@@ -401,7 +401,7 @@ @interface FlutterEmbedderKeyResponder ()
401401
* Its values are |responseId|s, and keys are the callback that was received
402402
* along with the event.
403403
*/
404-
@property(nonatomic, readonly)
404+
@property(nonatomic, copy, readonly)
405405
NSMutableDictionary<NSNumber*, FlutterAsyncKeyCallback>* pendingResponses;
406406

407407
/**
@@ -490,7 +490,7 @@ @implementation FlutterEmbedderKeyResponder
490490
- (nonnull instancetype)initWithSendEvent:(FlutterSendKeyEvent)sendEvent {
491491
self = [super init];
492492
if (self != nil) {
493-
_sendEvent = sendEvent;
493+
_sendEvent = [sendEvent copy];
494494
_pressingRecords = [[NSMutableDictionary alloc] init];
495495
_pendingResponses = [[NSMutableDictionary alloc] init];
496496
_responseId = 1;

0 commit comments

Comments
 (0)