mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-11 19:06:33 +00:00
Handle NULL GstIterator* correctly
This commit is contained in:
parent
3f74ddbae3
commit
3c4bf5f4e3
1 changed files with 7 additions and 2 deletions
|
@ -54,6 +54,9 @@ private class PadEnumerable : IEnumerable {
|
|||
IntPtr raw_ret;
|
||||
bool retry = false;
|
||||
|
||||
if (iterator == IntPtr.Zero)
|
||||
return false;
|
||||
|
||||
do {
|
||||
int ret = gst_iterator_next (iterator, out raw_ret);
|
||||
switch (ret) {
|
||||
|
@ -82,6 +85,7 @@ private class PadEnumerable : IEnumerable {
|
|||
|
||||
public void Reset () {
|
||||
seen.Clear ();
|
||||
if (iterator != IntPtr.Zero)
|
||||
gst_iterator_resync (iterator);
|
||||
}
|
||||
|
||||
|
@ -103,6 +107,7 @@ private class PadEnumerable : IEnumerable {
|
|||
}
|
||||
|
||||
~PadEnumerable () {
|
||||
if (iterator != IntPtr.Zero)
|
||||
gst_iterator_free (iterator);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue