This is strongly related to #284 but concerns SDL_SetVideoMode itself on Git main (at db10d6fc01a2a567ddf58e9890b3bbeb6fa5c77c over here). This time my test program is this:
// main.c
#include <SDL.h>
int main() {
SDL_Init(SDL_INIT_EVERYTHING);
SDL_SetVideoMode(640, 480, 32, SDL_RESIZABLE);
SDL_SetVideoMode(640, 480, 32, SDL_RESIZABLE); // second time, normally called on window resize
SDL_Quit();
return 0;
}
I am building like this (with no Makefile present):
# make main \
CFLAGS="$(pkg-config sdl12_compat --cflags) -g -fsanitize=address -fno-omit-frame-pointer" \
LDFLAGS="$(pkg-config sdl12_compat --libs) -g -fsanitize=address -fno-omit-frame-pointer" \
&& ./main
The output I get is this:
=================================================================
==7842==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7fbea0a87aff in __interceptor_calloc [..]/gcc-11-20221223/libsanitizer/asan/asan_malloc_linux.cpp:154
#1 0x7fbe9cea6721 in SDL_calloc_REAL [..]/sdl2/src/stdlib/SDL_malloc.c:5308
#2 0x56065c18819b in main /tmp/tmp.bPvwZKpCkR/main.c:6
#3 0x7fbea079e209 (/lib64/libc.so.6+0x2a209)
SUMMARY: AddressSanitizer: 40 byte(s) leaked in 1 allocation(s).
From my understanding, the second call to SDL_SetVideoMode is supposed to fully clean up the previous surface. It seems to do that with SDL 1.2 but not with sdl12-compat.
Hi!
This is strongly related to #284 but concerns
SDL_SetVideoMode
itself on Gitmain
(at db10d6fc01a2a567ddf58e9890b3bbeb6fa5c77c over here). This time my test program is this:I am building like this (with no Makefile present):
The output I get is this:
From my understanding, the second call to
SDL_SetVideoMode
is supposed to fully clean up the previous surface. It seems to do that with SDL 1.2 but not with sdl12-compat.What do you think?
Best, Sebastian