diff --git a/ffi/SDL2_0.lua b/ffi/SDL2_0.lua index 77573bf9a..7a3b2feb7 100644 --- a/ffi/SDL2_0.lua +++ b/ffi/SDL2_0.lua @@ -141,7 +141,7 @@ function S.open(w, h, x, y) -- What's even more curious is that we still only get a single SDL_WINDOWEVENT_MOVED on startup, except that way it's at the requested coordinates... SDL.SDL_SetWindowPosition(S.screen, pos_x, pos_y) - S.renderer = ffi.gc(SDL.SDL_CreateRenderer(S.screen, -1, 0), SDL.SDL_DestroyRenderer) + S.renderer = SDL.SDL_CreateRenderer(S.screen, -1, 0) local output_w = ffi.new("int[1]", 0) local output_h = ffi.new("int[1]", 0) if SDL.SDL_GetRendererOutputSize(S.renderer, output_w, output_h) == 0 and tonumber(output_w[0]) ~= w then diff --git a/ffi/framebuffer_SDL2_0.lua b/ffi/framebuffer_SDL2_0.lua index 26ed8e57f..ad670f74e 100644 --- a/ffi/framebuffer_SDL2_0.lua +++ b/ffi/framebuffer_SDL2_0.lua @@ -165,6 +165,7 @@ function framebuffer:setWindowIcon(icon) end function framebuffer:close() + SDL.SDL.SDL_DestroyRenderer(SDL.renderer) SDL.SDL.SDL_Quit() end