diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-06-02 13:09:34 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2014-06-02 13:09:34 -0400 |
commit | 36e399810a25d5d3a41570ee0f52f8e6d1402fbc (patch) | |
tree | 1fc01eeb8da903e7d29db13965c398395077f4fa /libdimension | |
parent | d9d93565f3b401e0f6c16e18a892ecbdab0dbe51 (diff) | |
download | dimension-36e399810a25d5d3a41570ee0f52f8e6d1402fbc.tar.xz |
canvas: Use the pool for the pixels too.
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/canvas.c | 9 |
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 */ |