Merge pull request #1662 from dneto0/fix-leak2

HLSL: Avoid leaking a shadow sampler struct
This commit is contained in:
John Kessenich 2019-01-17 06:29:41 +07:00 committed by GitHub
commit d9739794e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,7 @@
#include "hlslGrammar.h"
#include "hlslAttributes.h"
#include "../glslang/Include/Common.h"
#include "../glslang/MachineIndependent/Scan.h"
#include "../glslang/MachineIndependent/preprocessor/PpContext.h"
@ -3129,7 +3130,7 @@ TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc
if (textureShadowEntry != textureShadowVariant.end())
newId = textureShadowEntry->second->get(shadowMode);
else
textureShadowVariant[texSymbol->getId()] = new tShadowTextureSymbols;
textureShadowVariant[texSymbol->getId()] = NewPoolObject(tShadowTextureSymbols(), 1);
// Sometimes we have to create another symbol (if this texture has been seen before,
// and we haven't created the form for this shadow mode).