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