mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Fix love.event.quit causing crashes and other bad behaviour if a Canvas is active. Resolves issue #1395.
This commit is contained in:
@@ -271,11 +271,14 @@ bool Canvas::loadVolatile()
|
||||
|
||||
void Canvas::unloadVolatile()
|
||||
{
|
||||
// This is a bit ugly, but we need some way to destroy the cached FBO
|
||||
// when this Canvas' texture is destroyed.
|
||||
auto gfx = Module::getInstance<Graphics>(Module::M_GRAPHICS);
|
||||
if (gfx != nullptr)
|
||||
gfx->cleanupCanvas(this);
|
||||
if (fbo != 0 || renderbuffer != 0 || texture != 0)
|
||||
{
|
||||
// This is a bit ugly, but we need some way to destroy the cached FBO
|
||||
// when this Canvas' texture is destroyed.
|
||||
auto gfx = Module::getInstance<Graphics>(Module::M_GRAPHICS);
|
||||
if (gfx != nullptr)
|
||||
gfx->cleanupCanvas(this);
|
||||
}
|
||||
|
||||
if (fbo != 0)
|
||||
gl.deleteFramebuffer(fbo);
|
||||
|
||||
Reference in New Issue
Block a user