Keep a reference to the SDL video subsystem in the mouse module, since cursors need it. Potentially resolves issue #1388.

This commit is contained in:
Alex Szpakowski
2018-09-28 20:51:41 -03:00
parent cca5af66e8
commit 0cf106fa6a
+5
View File
@@ -57,6 +57,9 @@ const char *Mouse::getName() const
Mouse::Mouse()
: curCursor(nullptr)
{
// SDL may need the video subsystem in order to clean up the cursor when
// quitting. Subsystems are reference-counted.
SDL_InitSubSystem(SDL_INIT_VIDEO);
}
Mouse::~Mouse()
@@ -66,6 +69,8 @@ Mouse::~Mouse()
for (auto &c : systemCursors)
c.second->release();
SDL_QuitSubSystem(SDL_INIT_VIDEO);
}
love::mouse::Cursor *Mouse::newCursor(love::image::ImageData *data, int hotx, int hoty)