Skip to content

Commit

Permalink
Fixed|BSP Builder: Vertex allocation must be C++ new
Browse files Browse the repository at this point in the history
The partitioner was still allocating vertices using M_Malloc().
  • Loading branch information
skyjake committed Feb 8, 2013
1 parent d894f6e commit 5e01624
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions doomsday/client/src/map/bsp/partitioner.cpp
Expand Up @@ -1991,10 +1991,7 @@ struct Partitioner::Instance
*/
Vertex* newVertex(const_pvec2d_t origin)
{
Vertex* vtx;

// Allocate with M_Calloc for uniformity with the editable vertexes.
vtx = static_cast<Vertex*>(M_Calloc(sizeof *vtx));
Vertex* vtx = new Vertex;
vtx->buildData.index = numEditableVertexes + uint(vertexes.size() + 1); // 1-based index, 0 = NIL.
vertexes.push_back(vtx);

Expand Down Expand Up @@ -2443,9 +2440,10 @@ Vertex& Partitioner::vertex(uint idx)

Partitioner& Partitioner::release(de::MapElement* ob)
{
LOG_AS("Partitioner::release");

if(!d->release(ob))
{
LOG_AS("Partitioner::release");
LOG_DEBUG("Attempted to release an unknown/unowned object %p.") << de::dintptr(ob);
}
return *this;
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/map/bspbuilder.cpp
Expand Up @@ -83,6 +83,7 @@ uint BspBuilder::numVertexes()

Vertex& BspBuilder::vertex(uint idx)
{
DENG2_ASSERT(partitioner->vertex(idx).type() == DMU_VERTEX);
return partitioner->vertex(idx);
}

Expand Down

0 comments on commit 5e01624

Please sign in to comment.