summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdimension/canvas.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libdimension/canvas.c b/libdimension/canvas.c
index a86a48a..cb7e5ce 100644
--- a/libdimension/canvas.c
+++ b/libdimension/canvas.c
@@ -32,10 +32,10 @@ dmnsn_canvas *
dmnsn_new_canvas(dmnsn_pool *pool, size_t width, size_t height)
{
dmnsn_canvas *canvas = DMNSN_PALLOC_TIDY(pool, dmnsn_canvas, dmnsn_canvas_cleanup);
- canvas->width = width;
- canvas->height = height;
+ canvas->width = width;
+ canvas->height = height;
canvas->optimizers = DMNSN_NEW_ARRAY(dmnsn_canvas_optimizer);
- canvas->pixels = dmnsn_malloc(sizeof(dmnsn_tcolor)*width*height);
+ canvas->pixels = dmnsn_palloc(pool, sizeof(dmnsn_tcolor)*width*height);
return canvas;
}
@@ -51,9 +51,6 @@ dmnsn_canvas_cleanup(void *ptr)
}
}
dmnsn_delete_array(canvas->optimizers);
-
- /* Free the pixels and canvas */
- dmnsn_free(canvas->pixels);
}
/* Set a canvas optimizer */