mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-14 15:53:14 +00:00
Assert a valid window pointer instead of dismissing an invalid pointer
Throwing an assertion and breaking the program should allow developers
to catch wrong usage of the API faster.
Follow-up of 9493e6974f
This commit is contained in:
committed by
Anonymous Maarten
parent
125ce71379
commit
5cd6923298
@@ -43,9 +43,11 @@ int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent,
|
||||
{
|
||||
int posted;
|
||||
|
||||
if (!SDL_ObjectValid(window, SDL_OBJECT_TYPE_WINDOW)) {
|
||||
if (!window) {
|
||||
return 0;
|
||||
}
|
||||
SDL_assert(SDL_ObjectValid(window, SDL_OBJECT_TYPE_WINDOW));
|
||||
|
||||
if (window->is_destroying && windowevent != SDL_EVENT_WINDOW_DESTROYED) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user