aboutsummaryrefslogtreecommitdiff
path: root/src/RenderBackend
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-02-15 02:03:07 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-18 15:22:10 +0100
commit92a30e08849f45fa6f5efb1dd8897a4a69c063a6 (patch)
treefb2caa668aabc96b57fdef7041509f3e08b98f9b /src/RenderBackend
parente4d073947d09634e95325ddaf8f1615f85e85901 (diff)
Fix double free
Diffstat (limited to 'src/RenderBackend')
-rw-r--r--src/RenderBackend/OpenGL/ShaderProgram.cpp2
-rw-r--r--src/RenderBackend/OpenGL/Texture2D.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/RenderBackend/OpenGL/ShaderProgram.cpp b/src/RenderBackend/OpenGL/ShaderProgram.cpp
index 14b15aa..7990a82 100644
--- a/src/RenderBackend/OpenGL/ShaderProgram.cpp
+++ b/src/RenderBackend/OpenGL/ShaderProgram.cpp
@@ -12,7 +12,7 @@ namespace amalgine {
ShaderProgram::~ShaderProgram()
{
- GLint numAttachedShaders;
+ GLint numAttachedShaders = 0;
glGetProgramiv(program_id, GL_ATTACHED_SHADERS, &numAttachedShaders);
GLuint *attachedShaders = new GLuint[numAttachedShaders];
diff --git a/src/RenderBackend/OpenGL/Texture2D.cpp b/src/RenderBackend/OpenGL/Texture2D.cpp
index a561f6e..dcb9cef 100644
--- a/src/RenderBackend/OpenGL/Texture2D.cpp
+++ b/src/RenderBackend/OpenGL/Texture2D.cpp
@@ -7,10 +7,10 @@
namespace amalgine {
struct TextureIdAllocator {
TextureIdAllocator(){
- glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);
+ glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max_texture_units);
if(max_texture_units < 1)
max_texture_units = 1;
- printf("max texture units: %d\n", max_texture_units);
+ fprintf(stderr, "max texture units: %d\n", max_texture_units);
}
u32 get_free_texture_id() {