Fix model deallocation.
This commit is contained in:
parent
9702382a16
commit
3b6b133001
1 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,9 @@ int
|
||||||
model_free(Model *self) {
|
model_free(Model *self) {
|
||||||
free(self->object);
|
free(self->object);
|
||||||
free(self->colors);
|
free(self->colors);
|
||||||
|
for (int i = 0; i < self->transformation_count; i++) {
|
||||||
|
tensor_free(self->transformations[i]);
|
||||||
|
}
|
||||||
free(self->transformations);
|
free(self->transformations);
|
||||||
free(self);
|
free(self);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -102,7 +105,8 @@ model_applyTransformations(Model *self) {
|
||||||
retval = malloc(self->bufsize * 4 * sizeof(GLfloat));
|
retval = malloc(self->bufsize * 4 * sizeof(GLfloat));
|
||||||
for (int k = 0; k < self->bufsize; k++) {
|
for (int k = 0; k < self->bufsize; k++) {
|
||||||
for (int j = 0; j < 4; j++) {
|
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;
|
return retval;
|
||||||
|
|
Loading…
Reference in a new issue