mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Update gfxD3D11Shader.cpp
plugging leaks
This commit is contained in:
parent
37636bcd26
commit
78df01af55
1 changed files with 7 additions and 3 deletions
|
|
@ -613,7 +613,10 @@ GFXD3D11Shader::GFXD3D11Shader()
|
||||||
GFXD3D11Shader::~GFXD3D11Shader()
|
GFXD3D11Shader::~GFXD3D11Shader()
|
||||||
{
|
{
|
||||||
for (auto& pair : mHandles) {
|
for (auto& pair : mHandles) {
|
||||||
delete pair.value;
|
if (pair.value != nullptr) {
|
||||||
|
delete pair.value;
|
||||||
|
pair.value = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mHandles.clear();
|
mHandles.clear();
|
||||||
|
|
||||||
|
|
@ -1079,8 +1082,9 @@ void GFXD3D11Shader::_buildShaderConstantHandles()
|
||||||
{
|
{
|
||||||
// Mark all existing handles as invalid.
|
// Mark all existing handles as invalid.
|
||||||
// Those that are found when parsing the descriptions will then be marked valid again.
|
// Those that are found when parsing the descriptions will then be marked valid again.
|
||||||
for (HandleMap::Iterator iter = mHandles.begin(); iter != mHandles.end(); ++iter)
|
for (auto& pair : mHandles) {
|
||||||
(iter->value)->setValid(false);
|
pair.value->setValid(false);
|
||||||
|
}
|
||||||
|
|
||||||
// loop through all constants, add them to the handle map
|
// loop through all constants, add them to the handle map
|
||||||
// and add the const buffers to the buffer map.
|
// and add the const buffers to the buffer map.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue