summaryrefslogtreecommitdiff
path: root/src/render/gl_batch.h
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-11 00:41:44 +0100
committeraura <nw@moneybot.cc>2026-03-11 00:41:44 +0100
commit4c0ab7a739085a32688f34947c0b1812a31d92d7 (patch)
tree3b32fa706a61438160433c51585c8d3a70a5ab88 /src/render/gl_batch.h
parentd1233da64ae31a381fd484b446e87c2c55ed02b8 (diff)
fix mem leaks, string convenience funcs
Diffstat (limited to 'src/render/gl_batch.h')
-rw-r--r--src/render/gl_batch.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/render/gl_batch.h b/src/render/gl_batch.h
index e7f979c..31ed0ea 100644
--- a/src/render/gl_batch.h
+++ b/src/render/gl_batch.h
@@ -80,15 +80,19 @@ inline GL_BATCH<VERTEX>* gl_batch_create(
template <typename VERTEX>
inline void gl_batch_destroy( GL_BATCH<VERTEX>* batch ) {
glDeleteBuffers( 1, &batch->vbuffer );
- for( auto& it : batch->calls )
+ for( auto& it : batch->calls ) {
it.textures.clear();
+ it.vertices.clear();
+ }
delete batch;
}
template <typename VERTEX>
inline void gl_batch_empty( GL_BATCH<VERTEX>* batch ) {
- for( auto& it : batch->calls )
+ for( auto& it : batch->calls ) {
it.textures.clear();
+ it.vertices.clear();
+ }
batch->calls.clear();
}