Fix: Multitouch data handling memory safety#117
Merged
NullPointerDepressiveDisorder merged 2 commits intomainfrom Mar 5, 2026
Merged
Fix: Multitouch data handling memory safety#117NullPointerDepressiveDisorder merged 2 commits intomainfrom
NullPointerDepressiveDisorder merged 2 commits intomainfrom
Conversation
NullPointerDepressiveDisorder
previously approved these changes
Mar 5, 2026
Copilot started reviewing on behalf of
NullPointerDepressiveDisorder
March 5, 2026 22:24
View session
Contributor
Author
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a reported memory-safety issue in multitouch frame handling by changing how touch data is buffered across asynchronous processing on gestureQueue, aiming to prevent use-after-free/double-free scenarios during rapid sleep/wake cycles.
Changes:
- Replaced manual
UnsafeMutableRawPointerallocation/deallocation for touch-frame copies withData. - Updated the async
gestureQueueprocessing path to pass a pointer derived fromDataintoGestureRecognizer.processTouches.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Karan Mohindroo <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes MIDDLEDRAG-M. The issue was that: Rapid system sleep/wake cycles cause
DeviceMonitorto double-free an object due togPendingCleanupbeing prematurely released during new instance initialization.UnsafeMutableRawPointerallocation and deallocation for touch data with Swift'sDatatype.Dataobjects, simplifying lifetime management.This fix was generated by Seer in Sentry, triggered by Karan Mohindroo. 👁️ Run ID: 11264006
Not quite right? Click here to continue debugging with Seer.
Type of Change
Related Issues
Fixes MIDDLEDRAG-M
Testing Performed
Checklist
Code Coverage
Screenshots / Recordings
Additional Notes