From dc780ddcae62f8d772bf972ab15a51d3b9434198 Mon Sep 17 00:00:00 2001 From: Ben Payne Date: Tue, 11 Nov 2014 15:15:55 -0500 Subject: [PATCH] Fix use-after-delete --- Engine/source/materials/materialList.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/source/materials/materialList.cpp b/Engine/source/materials/materialList.cpp index fbeab64f3..afdba4f54 100644 --- a/Engine/source/materials/materialList.cpp +++ b/Engine/source/materials/materialList.cpp @@ -263,8 +263,6 @@ void MaterialList::clearMatInstList() if (mMatInstList[i]) { BaseMatInstance* current = mMatInstList[i]; - delete current; - mMatInstList[i] = NULL; // ok, since ts material lists can remap difference indexes to the same object // we need to make sure that we don't delete the same memory twice. walk the @@ -272,6 +270,9 @@ void MaterialList::clearMatInstList() for (U32 j=0; j