From 1b22bc55cea591f9ea60432870145354775cae9f Mon Sep 17 00:00:00 2001 From: Scott Campbell Date: Fri, 12 Apr 2024 11:07:09 +1000 Subject: [PATCH] Bug fix: stop leaking memory for allocated data data is newed without being deleted --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index ce0be1f..da4299c 100644 --- a/main.cpp +++ b/main.cpp @@ -25,6 +25,7 @@ bgfx::ShaderHandle loadShader(const char* _name) { file.close(); } const bgfx::Memory* mem = bgfx::copy(data,fileSize+1); + delete [] data; mem->data[mem->size-1] = '\0'; bgfx::ShaderHandle handle = bgfx::createShader(mem); bgfx::setName(handle, _name);