Browse Source

Fixed segfault when garbage collecting Shader objects

Alex Szpakowski 11 years ago
parent
commit
cb01e3f4d1
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/modules/graphics/opengl/Shader.cpp

+ 2 - 3
src/modules/graphics/opengl/Shader.cpp

@@ -98,10 +98,9 @@ Shader::~Shader()
 		detach();
 		detach();
 
 
 	for (auto it = boundRetainables.begin(); it != boundRetainables.end(); ++it)
 	for (auto it = boundRetainables.begin(); it != boundRetainables.end(); ++it)
-	{
 		it->second->release();
 		it->second->release();
-		boundRetainables.erase(it);
-	}
+
+	boundRetainables.clear();
 
 
 	unloadVolatile();
 	unloadVolatile();
 }
 }