Fix dealloc of MacWindow (#7708)
We see some panics in the Drop handler for MacWindow Looking into this, I noticed that our drop implementation was not correctly cleaning up the window state. Release Notes: - N/A
This commit is contained in:
parent
21d2b5fe50
commit
b800fe96d2
1 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ use raw_window_handle::{
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::{
|
use std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
cell::{Cell, RefCell},
|
cell::Cell,
|
||||||
ffi::{c_void, CStr},
|
ffi::{c_void, CStr},
|
||||||
mem,
|
mem,
|
||||||
ops::Range,
|
ops::Range,
|
||||||
|
@ -1086,7 +1086,7 @@ unsafe fn get_window_state(object: &Object) -> Arc<Mutex<MacWindowState>> {
|
||||||
|
|
||||||
unsafe fn drop_window_state(object: &Object) {
|
unsafe fn drop_window_state(object: &Object) {
|
||||||
let raw: *mut c_void = *object.get_ivar(WINDOW_STATE_IVAR);
|
let raw: *mut c_void = *object.get_ivar(WINDOW_STATE_IVAR);
|
||||||
Rc::from_raw(raw as *mut RefCell<MacWindowState>);
|
Arc::from_raw(raw as *mut Mutex<MacWindowState>);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" fn yes(_: &Object, _: Sel) -> BOOL {
|
extern "C" fn yes(_: &Object, _: Sel) -> BOOL {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue