yuwen.xiang Posted January 10, 2013 Share Posted January 10, 2013 HI! I create a earth model.and add image for it. add image for Node code: ObjectMeshDynamic* pTile = new ObjectMeshDynamic(); Image* image; image = getImage(...); if(image != NULL) { Material* matTex = pTile->getMaterialInherit(0); matTex->setImageTextureImage(matTex->findTexture("diffuse"),*image,1); } Now i create next layer,so i want to remove the old node.remove node code: string meshName = "mesh_"+xyw_replace(tt_tileKey,pattern,dstPattern); if(engine.materials->findMaterial(meshName.c_str())) { int retv = engine.materials->removeMaterial(meshName.c_str()); } _pGlobeRoot->removeChild(tileNode); // NodeDummy *_pGlobeRoot = new NodeDummy(); _pGlobeRoot is tree root node. if (engine.editor) { engine.editor->removeNode(tileNode); } But i find my computer's memory that go up,not go down. removeMaterial() function ,can it remove it's image? i think that the image is not remove??? Link to comment
frustum Posted January 16, 2013 Share Posted January 16, 2013 Maybe you should delete an image that you are getting by this function: Image *image = getImage(...); Link to comment
Recommended Posts