diff --git a/src/platform_sdl.c b/src/platform_sdl.c index 5fc5e0b..cf000bc 100755 --- a/src/platform_sdl.c +++ b/src/platform_sdl.c @@ -247,9 +247,6 @@ uint32_t platform_store_userdata(const char *name, void *bytes, int32_t len) { return file_store(path, bytes, len); } - - - #if defined(RENDERER_GL) // ---------------------------------------------------- #define PLATFORM_WINDOW_FLAGS SDL_WINDOW_OPENGL SDL_GLContext platform_gl; @@ -299,7 +296,10 @@ uint32_t platform_store_userdata(const char *name, void *bytes, int32_t len) { } void platform_video_cleanup() { - + if (screenbuffer) { + SDL_DestroyTexture(screenbuffer); + } + SDL_DestroyRenderer(renderer); } void platform_prepare_frame() { @@ -339,8 +339,6 @@ uint32_t platform_store_userdata(const char *name, void *bytes, int32_t len) { #error "Unsupported renderer for platform SDL" #endif - - int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER); @@ -418,6 +416,12 @@ int main(int argc, char *argv[]) { system_cleanup(); platform_video_cleanup(); + SDL_DestroyWindow(window); + + if (gamepad) { + SDL_GameControllerClose(gamepad); + } + if (sdl_path_assets) { SDL_free(sdl_path_assets); }