Don't deliver window events while it's being destroyed
This commit is contained in:
parent
bf4095359c
commit
432af82a88
|
@ -46,6 +46,9 @@ int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent,
|
|||
if (window == NULL) {
|
||||
return 0;
|
||||
}
|
||||
if (window->is_destroying) {
|
||||
return 0;
|
||||
}
|
||||
switch (windowevent) {
|
||||
case SDL_EVENT_WINDOW_SHOWN:
|
||||
if (!(window->flags & SDL_WINDOW_HIDDEN)) {
|
||||
|
|
|
@ -3001,10 +3001,6 @@ void SDL_CheckWindowDisplayChanged(SDL_Window *window)
|
|||
{
|
||||
int display_index;
|
||||
|
||||
if (window->is_destroying) {
|
||||
return;
|
||||
}
|
||||
|
||||
display_index = SDL_GetWindowDisplayIndex(window);
|
||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_DISPLAY_CHANGED, display_index, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue