Refactor SharedState so that it is no longer behind an Arc (#2573)
* Refactor SharedState so that it is no longer behind an Arc * Always use `Window::lock_shared_state`
This commit is contained in:
parent
32784af3c4
commit
2a58b785fe
4 changed files with 55 additions and 92 deletions
|
|
@ -148,7 +148,7 @@ declare_class!(
|
|||
#[sel(initWithId:acceptsFirstMouse:)]
|
||||
fn init_with_id(
|
||||
&mut self,
|
||||
window: *mut WinitWindow,
|
||||
window: &WinitWindow,
|
||||
accepts_first_mouse: bool,
|
||||
) -> Option<&mut Self> {
|
||||
let this: Option<&mut Self> = unsafe { msg_send![super(self), init] };
|
||||
|
|
@ -164,10 +164,7 @@ declare_class!(
|
|||
forward_key_to_app: false,
|
||||
};
|
||||
|
||||
Ivar::write(
|
||||
&mut this._ns_window,
|
||||
unsafe { Id::retain(window) }.expect("non-null window"),
|
||||
);
|
||||
Ivar::write(&mut this._ns_window, window.retain());
|
||||
Ivar::write(&mut this.state, Box::new(state));
|
||||
Ivar::write(&mut this.marked_text, NSMutableAttributedString::new());
|
||||
Ivar::write(&mut this.accepts_first_mouse, accepts_first_mouse);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue