Skip to content
Snippets Groups Projects
Commit c4287a0d authored by Břetislav Štec's avatar Břetislav Štec Committed by kwolekr
Browse files

src/wieldmesh.cpp: Fix mesh extrusion memory leak

parent ebe7b315
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define MIN_EXTRUSION_MESH_RESOLUTION 16
#define MAX_EXTRUSION_MESH_RESOLUTION 512
static scene::IMesh* createExtrusionMesh(int resolution_x, int resolution_y)
static scene::IMesh *createExtrusionMesh(int resolution_x, int resolution_y)
{
const f32 r = 0.5;
......@@ -114,8 +114,9 @@ static scene::IMesh* createExtrusionMesh(int resolution_x, int resolution_y)
mesh->addMeshBuffer(buf);
buf->drop();
scaleMesh(mesh, scale); // also recalculates bounding box
mesh = (scene::SMesh *)createForsythOptimizedMesh(mesh);
return mesh;
scene::IMesh *newmesh = createForsythOptimizedMesh(mesh);
mesh->drop();
return newmesh;
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment