File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,15 @@ @implementation MMKVStorage
1818
1919const int DATA_TYPE_ARRAY = 5 ;
2020
21-
21+ static dispatch_queue_t RCTGetMethodQueue ()
22+ {
23+ static dispatch_queue_t queue;
24+ static dispatch_once_t onceToken;
25+ dispatch_once (&onceToken, ^{
26+ queue = dispatch_queue_create (" MMKVStorage.Queue" , DISPATCH_QUEUE_SERIAL);
27+ });
28+ return queue;
29+ }
2230
2331MMKV *mmkv;
2432SecureStorage *secureStorage;
@@ -30,7 +38,7 @@ @implementation MMKVStorage
3038
3139- (dispatch_queue_t )methodQueue
3240{
33- return dispatch_get_main_queue ();
41+ return RCTGetMethodQueue ();
3442}
3543
3644- (id )init
@@ -49,7 +57,7 @@ - (id)init
4957
5058+ (BOOL )requiresMainQueueSetup
5159{
52- return NO ;
60+ return YES ;
5361}
5462
5563#pragma mark setupWithEncryption
@@ -536,4 +544,3 @@ -(void) encryptionHandler:(NSString *)ID
536544
537545@end
538546
539-
You can’t perform that action at this time.
0 commit comments