mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Fix a crash on quit if a non-default shader is active when quitting.
--HG-- branch : minor
This commit is contained in:
@@ -128,10 +128,10 @@ Graphics::Graphics()
|
|||||||
|
|
||||||
Graphics::~Graphics()
|
Graphics::~Graphics()
|
||||||
{
|
{
|
||||||
states.clear();
|
// Clean up standard shaders before the active shader. If we do it after,
|
||||||
|
// the active shader may try to activate a standard shader when deactivating
|
||||||
defaultFont.set(nullptr);
|
// itself, which will cause problems since it calls Graphics methods in the
|
||||||
|
// Graphics destructor.
|
||||||
for (int i = 0; i < Shader::STANDARD_MAX_ENUM; i++)
|
for (int i = 0; i < Shader::STANDARD_MAX_ENUM; i++)
|
||||||
{
|
{
|
||||||
if (Shader::standardShaders[i])
|
if (Shader::standardShaders[i])
|
||||||
@@ -141,6 +141,10 @@ Graphics::~Graphics()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
states.clear();
|
||||||
|
|
||||||
|
defaultFont.set(nullptr);
|
||||||
|
|
||||||
delete streamBufferState.vb[0];
|
delete streamBufferState.vb[0];
|
||||||
delete streamBufferState.vb[1];
|
delete streamBufferState.vb[1];
|
||||||
delete streamBufferState.indexBuffer;
|
delete streamBufferState.indexBuffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user