I have a quick question. I have the following code:
[code] Node* cubeNode = scene_->CreateChild(“Cube”);
cubeNode->SetPosition(Vector3(0,0,0));
StaticModel* boxModelComp = cubeNode->CreateComponent();
boxModelComp->SetModel( cache->GetResource(“Models/Box.mdl”) );
Material* mat = new Material(context_);
mat->SetNumTechniques(1);
mat->SetTechnique(0, cache->GetResource<Technique>("Techniques/Diff.xml") );
mat->SetTexture(TU_DIFFUSE, cache->GetResource<Texture2D>("Textures/UrhoIcon.png"));
boxModelComp->SetMaterial(0, mat);[/code]
Do I need to delete the old default material of the staticmodel component? Am I leaking memory?