diff options
author | Edward Hervey <bilboed@bilboed.com> | 2008-01-13 17:57:48 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2008-01-13 17:57:48 +0000 |
commit | 45b80b1e8c1181f6285696358b16b796966d0a97 (patch) | |
tree | a0c535badf6f61f217b5a731665c1c28d2d71eb9 /testsuite/test_pad.py | |
parent | 9077e68aaaa9773ab391226008545d4822c0b0d2 (diff) |
Re-implement wrapping of gst_pad_add_*probe in order to avoid leaks of user-data associated with the probes.
Original commit message from CVS:
reviewed by: Edward Hervey <edward.hervey@collabora.co.uk>
* gst/gstpad.override:
* testsuite/test_pad.py:
Re-implement wrapping of gst_pad_add_*probe in order to avoid leaks of
user-data associated with the probes.
Fixes #504786
Diffstat (limited to 'testsuite/test_pad.py')
-rw-r--r-- | testsuite/test_pad.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/testsuite/test_pad.py b/testsuite/test_pad.py index 2a19e7d..a5b3a1c 100644 --- a/testsuite/test_pad.py +++ b/testsuite/test_pad.py @@ -457,18 +457,21 @@ class PadProbePipeTest(TestCase): handle = None self._num_times_called = 0 - def buffer_probe(pad, buffer): + def buffer_probe(pad, buffer, data): self._num_times_called += 1 pad.remove_buffer_probe(handle) return True pad = self.fakesrc.get_pad('src') - handle = pad.add_buffer_probe(buffer_probe) + data = [] + handle = pad.add_buffer_probe(buffer_probe, data) self.pipeline.set_state(gst.STATE_PLAYING) m = self.pipeline.get_bus().poll(gst.MESSAGE_EOS, -1) assert m assert self._num_times_called == 1 self.pipeline.set_state(gst.STATE_NULL) + assert sys.getrefcount(buffer_probe) == 2 + assert sys.getrefcount(data) == 2 # FIXME: having m going out of scope doesn't seem to be enough # to get it gc collected, and it keeps a ref to the pipeline. # Look for a way to not have to do this explicitly |