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 authored and GitHub committed 2024-05-06 14:50:28 -07:00
1 parent 01d560df50
commit 56feecc17d
4 files changed
+15 -9

No files matched your search

+1 -1
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);