-
-
Notifications
You must be signed in to change notification settings - Fork 22.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS: Fix memory leak on touch input [3.x] #69200
Conversation
Just tested this in our game that uses quick tap controls. It indeed resolved the memory leak, and even more importantly, it eliminated the horrible input stutters / frame drops that were making the game unplayable even on new iPhones. Very much looking forward to seeing this merged, great work! |
e4ae262
to
bba1f69
Compare
@bruvzg This has been rebased. |
Replaces iOS gesture with touch implementation Fixes godotengine#66422 Remove godot_view_gesture_recognizer It's now unused. Remove input_devices/pointing/ios/touch_delay Unused with removal of gesture. Remove unused methods from interface Implementation made obsolete in prior commit Style conformance
bba1f69
to
28b11a0
Compare
...and once more with a squash. |
Thanks! |
Good stuff! Thanks all. Maybe the problem was hidden for us since the touch_delay was set to 0.01, but will definitely give it a try on the next RC, |
Fixes #66422 for 3.x branch. A fix for master is at #69201.
Replaces gesture recognizer with touch events directly from the view.
Rationale:
Gesture recognizers retain all touch events until their
state
property changes to "cancelled" or "ended."The custom recognizer in the project fails to implement this requirement.
Setting the state to "ended" in the recognizer resolves the leak but introduces runtime assertions in logic that relied on an unending recognizer.
By forwarding the touch events directly from the view to Godot removes the need for a gesture recognizer.
Furthermore, the motivation for delaying touch inputs looks to be resolved too. (See #39624)
This branch removes the delay from touch events, putting iOS on parity with other platforms.
Project setting
input_devices/pointing/ios/touch_delay
has been removed as a consequence.