opengl: fix readbackAsync causing crashes on quit.

Fixes #2298.
This commit is contained in:
Sasha Szpakowski
2026-03-28 16:11:38 -03:00
parent ab8dfaa1da
commit da216a7c58
2 changed files with 16 additions and 1 deletions
@@ -119,6 +119,17 @@ void GraphicsReadback::update()
}
}
bool GraphicsReadback::loadVolatile()
{
// Don't need to (re)create anything here, since the work is done in sync.fence().
return true;
}
void GraphicsReadback::unloadVolatile()
{
sync.cleanup();
}
} // opengl
} // graphics
} // love
@@ -22,6 +22,7 @@
// LOVE
#include "graphics/GraphicsReadback.h"
#include "graphics/Volatile.h"
#include "FenceSync.h"
#include "common/math.h"
@@ -32,7 +33,7 @@ namespace graphics
namespace opengl
{
class GraphicsReadback final : public love::graphics::GraphicsReadback
class GraphicsReadback final : public love::graphics::GraphicsReadback, public Volatile
{
public:
@@ -43,6 +44,9 @@ public:
void wait() override;
void update() override;
bool loadVolatile() override;
void unloadVolatile() override;
private:
FenceSync sync;