-
Notifications
You must be signed in to change notification settings - Fork 922
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
Remove unsound SendSyncWrapper
#3303
Remove unsound SendSyncWrapper
#3303
Conversation
e79d4ce
to
014f5d9
Compare
reading pointer value is not unsound by any means, if you deref raw pointers during
you can't do anything with it outside the main thread, and if you can do then builder has nothing to do with it, we have the same API throughout the code base on a Send + Sync types with the exact same values. |
I think you are talking about
I think there is a misunderstanding here. If this isn't an issue, then |
Window is |
This isn't the same thing, I hope the problem is apparent now, |
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.
Flyby review, unsure what's the correct approach here.
/// which is `unsafe`. | ||
#[derive(Debug, Clone)] | ||
#[cfg(feature = "rwh_06")] | ||
pub(crate) struct SendSyncRawWindowHandle(pub(crate) rwh_06::RawWindowHandle); |
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.
See also #3142 for improvements here.
014f5d9
to
55ec80e
Compare
55ec80e
to
1b9fb93
Compare
1b9fb93
to
5c1e056
Compare
I split out the Web part into #3320. |
5c1e056
to
54ba38f
Compare
I noticed that
SendSyncWrapper
caused some real issues here and there. First #3270 and #3288, then #3297.Also noticed that we simply used
SendSyncWrapper
onFullscreen
insideWindowBuilder
, but there is a getter that exposes this information to the user, bypassing the!Sync
onFullscreen
on MacOS, depending if this!Sync
was correct or not, that may have been unsound.Additionally on Web there was an issue where dropping
WindowBuilder
outside the main thread could cause it to try and dropHtmlCanvasElement
, which is unsound as well (not entirely sure if that is correct, but it's at least semantically correct).Additionally implementing
Debug
onSendSyncWrapper
was unsound as well, becauseDebug
could access the inner value off the only thread it was intended to be accessed on. Which was the case forWindowBuilder
on Web withHtmlCanvasElement
and the custom wrapper I used forCustomCursor
.All in all I would say
SendSyncWrapper
is a footgun and apart from theRawWindowHandle
v0.4 and v0.5 we didn't even really need it.