Skip to content

Commit

Permalink
src/wieldmesh.cpp: Fix mesh extrusion memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
t0suj4 authored and kwolekr committed Aug 2, 2015
1 parent ebe7b31 commit c4287a0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/wieldmesh.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit c4287a0

Please sign in to comment.