You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Windows 10, WIN_AddDisplays() seems to be called twice.
Additonally, in WIN_GetDisplayMode() there is a memory allocation:
data = (SDL_DisplayModeData *)SDL_malloc(sizeof(*data));
The second WIN_AddDisplays() call cause to override the first allocation causing the leak (220 bytes per each monitor you have and each time you call to init and quit the video system).
I dont know why this function is called twice (it could be on purpose or another bug that should be fixed) so, I have a patch that only avoid this memory leak modifying the SDL_SetDesktopDisplayMode() function.
WIN_AddDisplay() addressed a similar memory leak calling to SDL_ResetFullscreenDisplayModes() but nothing is done with the desktop mode.
It could not be the cleanest way of removing the memory leak but it was I am using on my project.
I'd like to find out why SDL_SetDesktopDisplayMode() is getting called twice. How many monitors do you have connected? Can you print out the value of info->szDevice before it gets called?
Windows updates the desktop display mode once at video init (in WIN_InitModes()) and once when creating a window (in WIN_RefreshDisplays())
Fixes#7982Fixes#8189
(cherry picked from commit bea34c5)
Windows updates the desktop display mode once at video init (in WIN_InitModes()) and once when creating a window (in WIN_RefreshDisplays())
Fixes#7982Fixes#8189
(cherry picked from commit bea34c5)
(cherry picked from commit 0ec1209)
In Windows 10, WIN_AddDisplays() seems to be called twice.
Additonally, in WIN_GetDisplayMode() there is a memory allocation:
data = (SDL_DisplayModeData *)SDL_malloc(sizeof(*data));
The second WIN_AddDisplays() call cause to override the first allocation causing the leak (220 bytes per each monitor you have and each time you call to init and quit the video system).
I dont know why this function is called twice (it could be on purpose or another bug that should be fixed) so, I have a patch that only avoid this memory leak modifying the SDL_SetDesktopDisplayMode() function.
WIN_AddDisplay() addressed a similar memory leak calling to SDL_ResetFullscreenDisplayModes() but nothing is done with the desktop mode.
It could not be the cleanest way of removing the memory leak but it was I am using on my project.
I have a patch here: main...RPP-dev:SDL:main
Before creating the pull request I would like to know your opinion on this fix.
Thanks
Regards
The text was updated successfully, but these errors were encountered: