瀏覽代碼

Properly releasing GpuProgInclude

Marko Pintera 13 年之前
父節點
當前提交
d4b6b593c2
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2 0
      CamelotClient/CamelotClient.cpp
  2. 1 1
      CamelotRenderer/Source/CmGpuProgInclude.cpp

+ 2 - 0
CamelotClient/CamelotClient.cpp

@@ -231,6 +231,8 @@ int CALLBACK WinMain(
 	
 	
 	//testMaterial->destroy();
 	//testMaterial->destroy();
 
 
+	gpuProgInclude.reset();
+
 	gResources().unload(testTexRef);
 	gResources().unload(testTexRef);
 	gResources().unload(dbgMeshRef);
 	gResources().unload(dbgMeshRef);
 	gResources().unload(fragProgRef);
 	gResources().unload(fragProgRef);

+ 1 - 1
CamelotRenderer/Source/CmGpuProgInclude.cpp

@@ -10,7 +10,7 @@ namespace CamelotEngine
 
 
 	GpuProgIncludeHandle GpuProgInclude::create(const String& includeString)
 	GpuProgIncludeHandle GpuProgInclude::create(const String& includeString)
 	{
 	{
-		GpuProgIncludePtr gpuProgIncludePtr = GpuProgIncludePtr(new GpuProgInclude(includeString));
+		GpuProgIncludePtr gpuProgIncludePtr = GpuProgIncludePtr(new GpuProgInclude(includeString), &CoreGpuObject::_deleteDelayed);
 		gpuProgIncludePtr->setThisPtr(gpuProgIncludePtr);
 		gpuProgIncludePtr->setThisPtr(gpuProgIncludePtr);
 		gpuProgIncludePtr->initialize();
 		gpuProgIncludePtr->initialize();