From 809c882062182afef2f68c4440194111ec4142ab Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 8 Nov 2010 01:08:51 -0500 Subject: Fix double-init bug for inherited textures. --- libdimension/texture.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libdimension/texture.c') diff --git a/libdimension/texture.c b/libdimension/texture.c index 7a012b5..9305f46 100644 --- a/libdimension/texture.c +++ b/libdimension/texture.c @@ -85,11 +85,12 @@ dmnsn_texture * dmnsn_new_texture() { dmnsn_texture *texture = dmnsn_malloc(sizeof(dmnsn_texture)); - texture->pigment = NULL; - texture->finish = NULL; - texture->trans = dmnsn_identity_matrix(); - texture->refcount = dmnsn_malloc(sizeof(unsigned int)); - *texture->refcount = 1; + texture->pigment = NULL; + texture->finish = NULL; + texture->trans = dmnsn_identity_matrix(); + texture->refcount = dmnsn_malloc(sizeof(unsigned int)); + *texture->refcount = 1; + texture->should_init = true; return texture; } -- cgit v1.2.3