You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a #warning in CLUUserInteractionModule class in startRecording method
- (void)startRecording {
if (!self.isRecording) {
[superstartRecording];
[_gestureRecognizer setObserverDelegate:self];
#warning If some window will be destroyed how to deattach gesture recognizer from it? Possible memory leak!
[[[UIApplication sharedApplication] keyWindow] addGestureRecognizer:_gestureRecognizer];
}
}
We're connecting gesture recognizer to specific window [[UIApplication sharedApplication] keyWindow].
Problems
Key window could change during the lifetime of the app.
What if current key window is different from current active window (in terms of touch events) at the moment
A window is considered the key window when it is currently receiving keyboard and non touch-related events. Whereas touch events are delivered to the window in which the touch occurred, events that don’t have an associated coordinate value are delivered to the key window. Only one window at a time can be key
Geek-1001
changed the title
Fix possible memory leak in CLUUserInteractionModule because of connected gesture recognizer
Fix possible memory leak in CLUUserInteractionModule because of connected gesture recognizer
Apr 24, 2017
Description
There is a #warning in
CLUUserInteractionModule
class instartRecording
methodWe're connecting gesture recognizer to specific window
[[UIApplication sharedApplication] keyWindow]
.Problems
References
CLUUserInteractionModule
CLUGeneralGestureRecognizer
The text was updated successfully, but these errors were encountered: