Fix seg-fault when using without a window (#1874)
* Fix seg-fault when using without a window #1869 * Update changelog
This commit is contained in:
parent
3571dcd68c
commit
4192d04a53
4 changed files with 16 additions and 11 deletions
|
|
@ -207,7 +207,10 @@ pub unsafe fn set_title_async(ns_window: id, title: String) {
|
|||
|
||||
// `close:` is thread-safe, but we want the event to be triggered from the main
|
||||
// thread. Though, it's a good idea to look into that more...
|
||||
pub unsafe fn close_async(ns_window: id) {
|
||||
//
|
||||
// ArturKovacs: It's important that this operation keeps the underlying window alive
|
||||
// through the `IdRef` because otherwise it would dereference free'd memory
|
||||
pub unsafe fn close_async(ns_window: IdRef) {
|
||||
let ns_window = MainThreadSafe(ns_window);
|
||||
Queue::main().exec_async(move || {
|
||||
autoreleasepool(move || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue