mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 08:56:25 +00:00
Make sure we always copy the data returned using SDL_GetStringRule
This prevents race conditions where calling an API from one thread returns the data and it's freed by updates on another thread
This commit is contained in:
@@ -65,7 +65,7 @@ static void SDL_FreePropertyWithCleanup(const void *key, const void *value, void
|
||||
}
|
||||
break;
|
||||
case SDL_PROPERTY_TYPE_STRING:
|
||||
SDL_FreeLater(property->value.string_value); // this pointer might be given to the app by SDL_GetStringProperty.
|
||||
SDL_FreeLater(property->value.string_value); // SDL_GetStringProperty() returns this pointer
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user