Skip to content

Commit aac7edc

Browse files
committed
Let ARC wipe memory
1 parent f14093a commit aac7edc

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ - (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
7676

7777
- (void)peripheralManagerDidUpdateState:(nonnull CBPeripheralManager *)peripheral {
7878
[_peripheralManager stopAdvertising];
79-
_peripheralManager = nil;
8079

8180
switch (peripheral.state) {
8281
case CBManagerStatePoweredOff:

ios/FaceID/RNPermissionHandlerFaceID.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ - (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
101101

102102
- (void)invalidateContext {
103103
[_laContext invalidate];
104-
_laContext = nil;
105104
}
106105

107106
- (void)UIApplicationDidBecomeActiveNotification:(__unused NSNotification *)notification {

ios/Motion/RNPermissionHandlerMotion.m

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,20 @@ - (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
5858
toDate:[NSDate date]
5959
toQueue:_operationQueue
6060
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);
7263
}
7364

74-
self->_operationQueue = nil;
75-
self->_activityManager = nil;
76-
7765
[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);
7875
}];
7976
}
8077

0 commit comments

Comments
 (0)