Browse Source

Let ARC wipe memory

Mathieu Acthernoene 5 years ago
parent
commit
aac7edc981

+ 0
- 1
ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m View File

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

+ 0
- 1
ios/FaceID/RNPermissionHandlerFaceID.m View File

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

+ 11
- 14
ios/Motion/RNPermissionHandlerMotion.m View File

58
                                            toDate:[NSDate date]
58
                                            toDate:[NSDate date]
59
                                           toQueue:_operationQueue
59
                                           toQueue:_operationQueue
60
                                       withHandler:^(NSArray<CMMotionActivity *> * _Nullable activities, NSError * _Nullable error) {
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
     [RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
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