mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Better cleanup when the graphics and window subsystems are destroyed and restarted.
This commit is contained in:
@@ -48,12 +48,18 @@ Window::Window()
|
||||
|
||||
Window::~Window()
|
||||
{
|
||||
if (context)
|
||||
{
|
||||
graphics::Graphics *gfx = Module::getInstance<graphics::Graphics>(Module::M_GRAPHICS);
|
||||
if (gfx != nullptr)
|
||||
gfx->unSetMode();
|
||||
|
||||
SDL_GL_DeleteContext(context);
|
||||
}
|
||||
|
||||
if (window)
|
||||
SDL_DestroyWindow(window);
|
||||
|
||||
if (context)
|
||||
SDL_GL_DeleteContext(context);
|
||||
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user