Fix property cleanup callback not being called on error (#9663)

The documentation for `SDL_SetPropertyWithCleanup` mentions that the cleanup function
is called upon failure. But this wasn't working in the code.
This commit is contained in:
Susko3
2024-05-06 23:50:28 +02:00
committed by GitHub
parent 01d560df50
commit 56feecc17d
4 changed files with 15 additions and 9 deletions

View File

@@ -293,7 +293,7 @@ static int properties_testCleanup(void *arg)
SDLTest_AssertPass("Call to SDL_SetProperty(cleanup)");
count = 0;
SDL_SetPropertyWithCleanup(props, "a", "0", cleanup, &count);
SDL_SetPropertyWithCleanup(props, "a", NULL, cleanup, &count);
SDL_ClearProperty(props, "a");
SDLTest_AssertCheck(count == 1,
"Verify cleanup for deleting property, got %d, expected 1", count);