فهرست منبع

Fixing a mem leak bug

Panagiotis Christopoulos Charitos 10 سال پیش
والد
کامیت
89a4257b1d
3فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 1 1
      include/anki/resource/Material.h
  2. 1 1
      src/resource/Material.cpp
  3. 0 2
      testapp/Main.cpp

+ 1 - 1
include/anki/resource/Material.h

@@ -66,7 +66,7 @@ public:
 	MaterialVariable()
 	{}
 
-	~MaterialVariable()
+	virtual ~MaterialVariable()
 	{}
 
 	/// Get the name.

+ 1 - 1
src/resource/Material.cpp

@@ -297,8 +297,8 @@ Error Material::createVars(const MaterialLoader& loader)
 		return ErrorCode::NONE;
 	});
 
-	m_vars.create(getAllocator(), count);
 	auto alloc = getAllocator();
+	m_vars.create(alloc, count);
 
 	// Find the name
 	count = 0;

+ 0 - 2
testapp/Main.cpp

@@ -248,7 +248,6 @@ Error init()
 		move->setLocalRotation(Mat3x4(Axisang(toRad(90.0), Vec3(0, 1, 0))));
 	}
 
-#if 1
 	{
 		ScriptResourcePtr script;
 
@@ -258,7 +257,6 @@ Error init()
 		err = app->getScriptManager().evalString(script->getSource());
 		if(err) return err;
 	}
-#endif
 
 	/*{
 		SceneNode* node = scene.tryFindSceneNode("Point_026");