Stop eating my RAM
This commit is contained in:
parent
0ea88cb6bc
commit
68d3d4b692
2 changed files with 2 additions and 5 deletions
5
src/cx.c
5
src/cx.c
|
@ -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:
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue