Skip to content

Commit 0572462

Browse files
authored
Change handler reference to weak pointer to prevent memleaks (#3987)
This PR fixes a memory leak by breaking a retain cycle between RNGestureHandler and RNManualActivationRecognizer. The RNGestureHandler owns the _manualActivationRecognizer with a strong reference, and previously the recognizer was holding a strong reference back to the handler, creating a cycle that prevented both objects from being deallocated.
1 parent 1f40473 commit 0572462

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native-gesture-handler/apple/RNManualActivationRecognizer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#import "RNGestureHandler.h"
33

44
@implementation RNManualActivationRecognizer {
5-
RNGestureHandler *_handler;
5+
__weak RNGestureHandler *_handler;
66
int _activePointers;
77
}
88

0 commit comments

Comments
 (0)