mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Set os::Window user data to nullptr before setting mouse cursors
In this way we don't process any queued native message for the display as it will be deleted. This could be a possible fix for some crashes reported in set_native_cursor_on_all_displays() (#2907)
This commit is contained in:
parent
0f04e016b6
commit
07cf70361b
@ -1503,6 +1503,11 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
|
||||
window->setBounds(newBounds);
|
||||
}
|
||||
|
||||
// Set the native window user data to nullptr so any other queued
|
||||
// native message is not processed.
|
||||
window->setDisplay(nullptr, false);
|
||||
windowDisplay->nativeWindow()->setUserData<void*>(nullptr);
|
||||
|
||||
// Remove all messages for this display.
|
||||
removeMessagesForDisplay(windowDisplay);
|
||||
|
||||
@ -1510,9 +1515,6 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
|
||||
// delete.
|
||||
_internal_set_mouse_display(parentDisplay);
|
||||
|
||||
window->setDisplay(nullptr, false);
|
||||
windowDisplay->nativeWindow()->setUserData<void*>(nullptr);
|
||||
|
||||
// The ui::Display should destroy the os::Window
|
||||
delete windowDisplay;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user