mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-11 22:08:15 +00:00
fixed some memory leaks, still issue with material index allocation leaking 4 bytes (possibly double allocation) (#964)
This commit is contained in:
@@ -2918,6 +2918,7 @@ static Model LoadOBJ(const char *fileName)
|
||||
tinyobj_attrib_free(&attrib);
|
||||
tinyobj_shapes_free(meshes, meshCount);
|
||||
tinyobj_materials_free(materials, materialCount);
|
||||
RL_FREE(data); // oh ray how did you miss this...! :-p
|
||||
}
|
||||
|
||||
// NOTE: At this point we have all model data loaded
|
||||
|
@@ -2967,7 +2967,8 @@ char *LoadText(const char *fileName)
|
||||
Shader LoadShader(const char *vsFileName, const char *fsFileName)
|
||||
{
|
||||
Shader shader = { 0 };
|
||||
shader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int));
|
||||
// double allocation causing leak (allocation done in LoadShaderCode)
|
||||
//shader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int));
|
||||
|
||||
char *vShaderStr = NULL;
|
||||
char *fShaderStr = NULL;
|
||||
|
Reference in New Issue
Block a user