GNOME Bugzilla – Bug 736680
basesrc: possible pool and allocator leak in prepare_allocation()
Last modified: 2014-09-16 08:32:41 UTC
I notice that I have a bufferpool leak when start method of bufferpool returns FALSE with a source element. It caused by the fact that gst_base_src_prepare_allocation or gst_base_src_set_allocation don't unref pool and allocator when a bufferpool can't be active. I will attach two differents solutions.
Created attachment 286210 [details] [review] basesrc: don't leak pool and allocator when activate failed Solution 1: just unref pool and allocator in error case. It assume that gst_base_src_set_allocation take reference on pool and allocator given as argument.
Created attachment 286211 [details] [review] basesrc: handle reference in set_allocation rather than in prepare_allocation Solution 2: gst_base_src_set_allocation() now reference pool and allocator and caller gst_base_src_prepare_allocation() unref its pool and allocator.
commit fefd6d06a1ede32573730e1f99f19bf1da4b6fd5 Author: Aurélien Zanelli <aurelien.zanelli@parrot.com> Date: Mon Sep 15 16:38:17 2014 +0200 basesrc: handle reference in set_allocation rather than in prepare_allocation Otherwise we can forget to unref objects in error cases. https://bugzilla.gnome.org/show_bug.cgi?id=736680