Ver código fonte

Let ARC wipe memory

Mathieu Acthernoene 5 anos atrás
pai
commit
aac7edc981

+ 0
- 1
ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m Ver arquivo

@@ -76,7 +76,6 @@
76 76
 
77 77
 - (void)peripheralManagerDidUpdateState:(nonnull CBPeripheralManager *)peripheral {
78 78
   [_peripheralManager stopAdvertising];
79
-  _peripheralManager = nil;
80 79
 
81 80
   switch (peripheral.state) {
82 81
     case CBManagerStatePoweredOff:

+ 0
- 1
ios/FaceID/RNPermissionHandlerFaceID.m Ver arquivo

@@ -101,7 +101,6 @@
101 101
 
102 102
 - (void)invalidateContext {
103 103
   [_laContext invalidate];
104
-  _laContext = nil;
105 104
 }
106 105
 
107 106
 - (void)UIApplicationDidBecomeActiveNotification:(__unused NSNotification *)notification {

+ 11
- 14
ios/Motion/RNPermissionHandlerMotion.m Ver arquivo

@@ -58,23 +58,20 @@
58 58
                                            toDate:[NSDate date]
59 59
                                           toQueue:_operationQueue
60 60
                                       withHandler:^(NSArray<CMMotionActivity *> * _Nullable activities, NSError * _Nullable error) {
61
-    if (error != nil) {
62
-      if (error.code != CMErrorNotAuthorized &&
63
-          error.code != CMErrorMotionActivityNotAuthorized) {
64
-        reject(error);
65
-      } else {
66
-        resolve(RNPermissionStatusDenied);
67
-      }
68
-    } else if (activities) {
69
-      resolve(RNPermissionStatusAuthorized);
70
-    } else {
71
-      resolve(RNPermissionStatusNotDetermined);
61
+    if (error != nil && error.code != CMErrorNotAuthorized && error.code != CMErrorMotionActivityNotAuthorized) {
62
+      return reject(error);
72 63
     }
73 64
 
74
-    self->_operationQueue = nil;
75
-    self->_activityManager = nil;
76
-
77 65
     [RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
66
+
67
+    if (error != nil) {
68
+      return resolve(RNPermissionStatusDenied);
69
+    }
70
+    if (activities) {
71
+      return resolve(RNPermissionStatusAuthorized);
72
+    }
73
+
74
+    return resolve(RNPermissionStatusNotDetermined);
78 75
   }];
79 76
 }
80 77