Verified Commit 89869532 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: avoid memory leak

parent e26808c9
......@@ -165,13 +165,14 @@ int BVHModelBase::beginModel(int num_tris_, int num_vertices_)
num_tris_allocated = num_tris_;
tri_indices = new Triangle[num_tris_allocated];
vertices = new Vec3f[num_vertices_allocated];
if(!tri_indices)
{
std::cerr << "BVH Error! Out of memory for tri_indices array on BeginModel() call!" << std::endl;
return BVH_ERR_MODEL_OUT_OF_MEMORY;
}
vertices = new Vec3f[num_vertices_allocated];
if(!vertices)
{
std::cerr << "BVH Error! Out of memory for vertices array on BeginModel() call!" << std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment