diff --git a/src/graphics/texture.c b/src/graphics/texture.c index 7759fe09..8687ca42 100644 --- a/src/graphics/texture.c +++ b/src/graphics/texture.c @@ -7,6 +7,7 @@ Texture* lovrTextureCreate(void* data, int size) { Texture* texture = malloc(sizeof(Texture)); if (!texture) return NULL; + texture->buffer = 0; glGenTextures(1, &texture->id); if (data) { @@ -24,8 +25,6 @@ Texture* lovrTextureCreate(void* data, int size) { free(image); } - texture->buffer = 0; - return texture; }