Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Leaks list
mlx_init.c:
84: glCreateShader(type)
The shader was not being deleted correctly, it has to be detached
before being deleted, the documentation says you only need to use
glDeleteProgram and they'll be detached but from my tests it is
not true
120: glCreateProgram()
The shader program wasn't being deleted at all with glDeleteProgram
124: glLinkProgram(mlxctx->shaderprogram)
I have very hard time understanding the underlaying system, the docs
don't make any reference to it, but calling again glLinkProgram
before deleting shaderprogram frees the leaks generated from the first call
88: glShaderSource(shader, 1, &code, &len)
I figued out the leak consists in the copy of the code allocated for the shader
but I could't understand how to free it, apparently glDeleteShader doesn't take
care of it
New mlx_terminate with modifications: