diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-06-08 16:08:09 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-06-08 16:08:09 +0300 |
commit | 5b014911a51651d736671da1a0ca96bfe0cd8eba (patch) | |
tree | 7ecc381ed783213482f198d4c283f8032ec65431 /source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc | |
parent | 23fd576cf8adb4269d40110e0d5e893e464af6a1 (diff) |
Revert "Cleanup: use cpp new/delete."
This reverts commit 43464c94f4def8689dd99a9e459f5ff77420d27b.
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc')
-rw-r--r-- | source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc index 48e57b45963..6237529902b 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc @@ -35,7 +35,7 @@ static void *extract_lines_init(const MeshRenderData *mr, struct MeshBatchCache *UNUSED(cache), void *UNUSED(buf)) { - GPUIndexBufBuilder *elb = new GPUIndexBufBuilder(); + GPUIndexBufBuilder *elb = static_cast<GPUIndexBufBuilder *>(MEM_mallocN(sizeof(*elb), __func__)); /* Put loose edges at the end. */ GPU_indexbuf_init( elb, GPU_PRIM_LINES, mr->edge_len + mr->edge_loose_len, mr->loop_len + mr->loop_loose_len); @@ -146,7 +146,7 @@ static void extract_lines_finish(const MeshRenderData *UNUSED(mr), GPUIndexBufBuilder *elb = static_cast<GPUIndexBufBuilder *>(data); GPUIndexBuf *ibo = static_cast<GPUIndexBuf *>(buf); GPU_indexbuf_build_in_place(elb, ibo); - delete elb; + MEM_freeN(elb); } constexpr MeshExtract create_extractor_lines() @@ -190,7 +190,7 @@ static void extract_lines_with_lines_loose_finish(const MeshRenderData *mr, GPUIndexBuf *ibo = static_cast<GPUIndexBuf *>(buf); GPU_indexbuf_build_in_place(elb, ibo); extract_lines_loose_subbuffer(mr, cache); - delete (elb); + MEM_freeN(elb); } constexpr MeshExtract create_extractor_lines_with_lines_loose() @@ -221,7 +221,7 @@ static void *extract_lines_loose_only_init(const MeshRenderData *mr, BLI_assert(buf == cache->final.ibo.lines_loose); UNUSED_VARS_NDEBUG(buf); extract_lines_loose_subbuffer(mr, cache); - return nullptr; + return NULL; } constexpr MeshExtract create_extractor_lines_loose_only() |