Always enable object validation when checking is explicitly enabled

This commit is contained in:
Sam Lantinga
2025-10-01 13:53:19 -07:00
parent f66e4d0a43
commit 33c849d030
2 changed files with 6 additions and 1 deletions

View File

@@ -137,12 +137,13 @@ Uint32 SDL_GetNextObjectID(void)
static SDL_InitState SDL_objects_init;
static SDL_HashTable *SDL_objects;
bool SDL_object_validation = false;
bool SDL_object_validation = true;
static void SDLCALL SDL_InvalidParamChecksChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
{
bool validation_enabled = true;
#ifndef OBJECT_VALIDATION_REQUIRED
if (hint) {
switch (*hint) {
case '0':
@@ -156,6 +157,8 @@ static void SDLCALL SDL_InvalidParamChecksChanged(void *userdata, const char *na
break;
}
}
#endif // !OBJECT_VALIDATION_REQUIRED
SDL_object_validation = validation_enabled;
}