Skip to content

Commit f80ee10

Browse files
sberube1igcbot
authored andcommitted
Fixed memory leak
Fixed memory leak
1 parent 7fc9203 commit f80ee10

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

IGC/common/igc_regkeys.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,9 @@ void appendToOptionsLogFile(std::string const &message)
10441044
os.close();
10451045
}
10461046

1047-
static thread_local ShaderHash g_CurrentShaderHash;
10481047
static thread_local std::vector<std::string> g_CurrentEntryPointNames;
1048+
1049+
static thread_local ShaderHash g_CurrentShaderHash;
10491050
void SetCurrentDebugHash(const ShaderHash& hash)
10501051
{
10511052
g_CurrentShaderHash = hash;
@@ -1062,6 +1063,7 @@ void ClearCurrentEntryPoints()
10621063
g_CurrentEntryPointNames.clear();
10631064
}
10641065

1066+
10651067
bool CheckHashRange(SRegKeyVariableMetaData& varname)
10661068
{
10671069
if (varname.hashes.empty()) {
@@ -1118,16 +1120,19 @@ bool CheckEntryPoint(SRegKeyVariableMetaData& varname)
11181120
std::string msg = "Warning: entry point not set yet; IGC_GET_FLAG_VALUE(" + std::string(varname.GetName()) + ") returned default value";
11191121
appendToOptionsLogFile(msg);
11201122
}
1121-
//looping entry point recorded by regkey metadata
1122-
for (auto& it : varname.entry_points)
1123+
11231124
{
1124-
//looping each entry point of current shader
1125-
for (std::string& CurrEntryPoint : g_CurrentEntryPointNames)
1125+
//looping entry point recorded by regkey metadata
1126+
for (auto& it : varname.entry_points)
11261127
{
1127-
if (CurrEntryPoint == it.entry_point_name)
1128+
//looping each entry point of current shader
1129+
for (std::string& CurrEntryPoint : g_CurrentEntryPointNames)
11281130
{
1129-
varname.m_Value = it.m_Value;
1130-
return true;
1131+
if (CurrEntryPoint == it.entry_point_name)
1132+
{
1133+
varname.m_Value = it.m_Value;
1134+
return true;
1135+
}
11311136
}
11321137
}
11331138
}

0 commit comments

Comments
 (0)