mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fix hash map collisions when setting canvases.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "Canvas.h"
|
||||
#include "graphics/Graphics.h"
|
||||
#include "Graphics.h"
|
||||
|
||||
#include <algorithm> // For min/max
|
||||
|
||||
@@ -270,6 +271,12 @@ 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)
|
||||
gl.deleteFramebuffer(fbo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user