glslang: In ShFinalize: 1) Delete CommonSymbolTable entries. 2) After deleting objects, set the pointers to NULL. This allows us to cleanly restart glslang a second time in the same process, because it forces a new allocation. Contributor: Andrew Woloszyn (awoloszyn@google.com).

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31110 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-05-08 01:03:55 +00:00
parent bb8c3de8b3
commit 57193ecdc3

View File

@ -644,14 +644,28 @@ void ShDestruct(ShHandle handle)
// //
int __fastcall ShFinalize() int __fastcall ShFinalize()
{ {
for (int version = 0; version < VersionCount; ++version) for (int version = 0; version < VersionCount; ++version) {
for (int p = 0; p < ProfileCount; ++p) for (int p = 0; p < ProfileCount; ++p) {
for (int lang = 0; lang < EShLangCount; ++lang) for (int lang = 0; lang < EShLangCount; ++lang) {
delete SharedSymbolTables[version][p][lang]; delete SharedSymbolTables[version][p][lang];
SharedSymbolTables[version][p][lang] = 0;
}
}
}
for (int version = 0; version < VersionCount; ++version) {
for (int p = 0; p < ProfileCount; ++p) {
for (int pc = 0; pc < EPcCount; ++pc) {
delete CommonSymbolTable[version][p][pc];
CommonSymbolTable[version][p][pc] = 0;
}
}
}
if (PerProcessGPA) { if (PerProcessGPA) {
PerProcessGPA->popAll(); PerProcessGPA->popAll();
delete PerProcessGPA; delete PerProcessGPA;
PerProcessGPA = 0;
} }
return 1; return 1;