From: malc Date: Sun, 2 Dec 2012 19:06:07 +0000 (+0400) Subject: Don't leak memory don't do unnecessary things X-Git-Tag: v14~90 X-Git-Url: https://repo.or.cz/w/llpp.git/commitdiff_plain/fef1ea273314e6dbd35f6b4732da18c7df42cb8b Don't leak memory don't do unnecessary things --- diff --git a/link.c b/link.c index c2ac33b..fb25bed 100644 --- a/link.c +++ b/link.c @@ -589,6 +589,9 @@ static void freetile (struct tile *tile) state.pig = tile->pixmap; #endif } + else { + free (tile->pbo); + } free (tile); } @@ -3435,8 +3438,6 @@ CAMLprim value ml_freepbo (value s_v) struct tile *tile = parse_pointer ("ml_freepbo", s); if (tile->pbo) { - state.glBindBufferARB (GL_PIXEL_UNPACK_BUFFER_ARB, tile->pbo->id); - state.glUnmapBufferARB (GL_PIXEL_UNPACK_BUFFER_ARB); state.glDeleteBuffersARB (1, &tile->pbo->id); tile->pbo->id = -1; tile->pbo->ptr = NULL;