mirror of https://github.com/bkaradzic/bgfx
Fix leak - using no fancy smanshy new age voodoo (#2390)
This commit is contained in:
parent
0cbc215c02
commit
d89ff312a7
|
@ -625,15 +625,15 @@ namespace bgfx { namespace metal
|
|||
|
||||
glslang::InitializeProcess();
|
||||
|
||||
glslang::TProgram* program = new glslang::TProgram;
|
||||
|
||||
EShLanguage stage = getLang(_options.shaderType);
|
||||
if (EShLangCount == stage)
|
||||
{
|
||||
bx::printf("Error: Unknown shader type '%c'.\n", _options.shaderType);
|
||||
return false;
|
||||
}
|
||||
glslang::TShader* shader = new glslang::TShader(stage);
|
||||
|
||||
glslang::TProgram* program = new glslang::TProgram;
|
||||
glslang::TShader* shader = new glslang::TShader(stage);
|
||||
|
||||
EShMessages messages = EShMessages(0
|
||||
| EShMsgDefault
|
||||
|
@ -788,6 +788,8 @@ namespace bgfx { namespace metal
|
|||
}
|
||||
|
||||
// recompile with the unused uniforms converted to statics
|
||||
delete program;
|
||||
delete shader;
|
||||
return compile(_options, _version, output.c_str(), _writer, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -741,15 +741,15 @@ namespace bgfx { namespace spirv
|
|||
|
||||
glslang::InitializeProcess();
|
||||
|
||||
glslang::TProgram* program = new glslang::TProgram;
|
||||
|
||||
EShLanguage stage = getLang(_options.shaderType);
|
||||
if (EShLangCount == stage)
|
||||
{
|
||||
bx::printf("Error: Unknown shader type '%c'.\n", _options.shaderType);
|
||||
return false;
|
||||
}
|
||||
glslang::TShader* shader = new glslang::TShader(stage);
|
||||
|
||||
glslang::TProgram* program = new glslang::TProgram;
|
||||
glslang::TShader* shader = new glslang::TShader(stage);
|
||||
|
||||
EShMessages messages = EShMessages(0
|
||||
| EShMsgDefault
|
||||
|
@ -934,6 +934,8 @@ namespace bgfx { namespace spirv
|
|||
output = uniformBlock + output;
|
||||
|
||||
// recompile with the unused uniforms converted to statics
|
||||
delete program;
|
||||
delete shader;
|
||||
return compile(_options, _version, output.c_str(), _writer, false);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue