diff --git a/src/model.c b/src/model.c index a5d1ff2..73dd8b6 100644 --- a/src/model.c +++ b/src/model.c @@ -16,6 +16,9 @@ int model_free(Model *self) { free(self->object); free(self->colors); + for (int i = 0; i < self->transformation_count; i++) { + tensor_free(self->transformations[i]); + } free(self->transformations); free(self); return 0; @@ -102,7 +105,8 @@ model_applyTransformations(Model *self) { retval = malloc(self->bufsize * 4 * sizeof(GLfloat)); for (int k = 0; k < self->bufsize; k++) { for (int j = 0; j < 4; j++) { - retval[k*4+j] = temp_buffer[(i+1)%2]->data[j*temp_buffer[(i+1)%2]->width+k]; + retval[k*4+j] = temp_buffer[(i+1)%2] + ->data[j*temp_buffer[(i+1)%2]->width+k]; } } return retval;