Use SafeRelease and SafeDelete to make sure released objects are NULL and will cause proper errors if referenced again.
TRAC #23617
Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Geoff Lang
diff --git a/src/libGLESv2/renderer/InputLayoutCache.cpp b/src/libGLESv2/renderer/InputLayoutCache.cpp
index 566f27d..24179c0 100644
--- a/src/libGLESv2/renderer/InputLayoutCache.cpp
+++ b/src/libGLESv2/renderer/InputLayoutCache.cpp
@@ -53,7 +53,7 @@
{
for (InputLayoutMap::iterator i = mInputLayoutMap.begin(); i != mInputLayoutMap.end(); i++)
{
- i->second.inputLayout->Release();
+ SafeRelease(i->second.inputLayout);
}
mInputLayoutMap.clear();
markDirty();
@@ -156,7 +156,7 @@
leastRecentlyUsed = i;
}
}
- leastRecentlyUsed->second.inputLayout->Release();
+ SafeRelease(leastRecentlyUsed->second.inputLayout);
mInputLayoutMap.erase(leastRecentlyUsed);
}