-
Notifications
You must be signed in to change notification settings - Fork 555
[UIKit] UIGestureRecognizer's custon OnDispose method needs to queue the actual operation on the main thread #5402
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
[UIKit] UIGestureRecognizer's custon OnDispose method needs to queue the actual operation on the main thread #5402
Conversation
…the actual operation on the main thread
spouliot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling RemoveTarget one the main thread (delayed) fix the reported issue.
Another way (I was trying) would be to remove the thread-check on RemoveTarget since it seem (at least Apple Main Thread Checker allows it) to be a thread safe call.
|
Build failure Test results1 tests failed, 0 tests skipped, 80 tests passed.Failed tests
|
|
The problem is that by the time it hits the main thread, the handle will have been cleared. The Dispose() implementation just injects the result of the Dispose attribute, before calling Dispose(disposing). So there would be a potential race where the finalizer queue would run first, and release the handle, so our handle would be pointing to garbage. That is why I took the ref, and then released it manually. |
|
Do we really need to call |
|
The hook is executed for all Dispose() kinds of invocations. I do not think it harms to keep it. |
…izer-regression [UIKit] UIGestureRecognizer's custon OnDispose method needs to queue the actual operation on the main thread
|
I think this PR broke this test: |
…egression (#5414) [UIKit] UIGestureRecognizer's custon OnDispose method needs to queue the actual operation on the main thread
Proposed fixed for:
#5388