[vlc-devel] [PATCH] picture_pool: do not unconditionally free the pictures

Luca Barbato lu_zero at gentoo.org
Thu Jul 11 08:20:29 CEST 2013


If a picture is still referenced would be double-freed.
---

If there are places that assume that picture_pool_Delete must wipe all
the references doesn't matter what we can add a second function.

 src/misc/picture_pool.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
index 14db3b6..356aff3 100644
--- a/src/misc/picture_pool.c
+++ b/src/misc/picture_pool.c
@@ -195,11 +195,6 @@ void picture_pool_Delete(picture_pool_t *pool)
             assert(vlc_atomic_get(&picture->gc.refcount) == 0);
             assert(!pool->picture_reserved[i]);

-            /* Restore old release callback */
-            vlc_atomic_set(&picture->gc.refcount, 1);
-            picture->gc.pf_destroy = gc_sys->destroy;
-            picture->gc.p_sys      = gc_sys->destroy_sys;
-
             picture_Release(picture);

             free(gc_sys);
--
1.8.2.1




More information about the vlc-devel mailing list