Stop eating my RAM

This commit is contained in:
Marcel Plch 2024-11-10 23:20:25 +01:00
parent 0ea88cb6bc
commit 68d3d4b692
Signed by: dormouse
GPG key ID: 2CA77596BC4BDFFE
2 changed files with 2 additions and 5 deletions

View file

@ -162,7 +162,6 @@ cx_init(CX_Context **cx_ctx) {
gl_ctx->ProgramID_count = 0; gl_ctx->ProgramID_count = 0;
gl_ctx->ProgramID_size = 1; gl_ctx->ProgramID_size = 1;
// Establish a model registry // Establish a model registry
gl_ctx->mr = modelRegistry_new(); gl_ctx->mr = modelRegistry_new();
@ -178,10 +177,6 @@ cx_init(CX_Context **cx_ctx) {
goto err; goto err;
} }
return 0; return 0;
err: err:

View file

@ -92,6 +92,7 @@ model_applyTransformations(Model *self) {
if (!self->transformation_count) { if (!self->transformation_count) {
retval = malloc(self->bufsize * 4 * sizeof(GLfloat)); retval = malloc(self->bufsize * 4 * sizeof(GLfloat));
memcpy(retval, self->object, self->bufsize * 4 * sizeof(GLfloat)); memcpy(retval, self->object, self->bufsize * 4 * sizeof(GLfloat));
tensor_free(temp_buffer[1]);
return retval; return retval;
} }
@ -109,6 +110,7 @@ model_applyTransformations(Model *self) {
->data[j*temp_buffer[(i+1)%2]->width+k]; ->data[j*temp_buffer[(i+1)%2]->width+k];
} }
} }
tensor_free(temp_buffer[(i+1)%2]);
return retval; return retval;
} }