[gst-cvs] gstreamer-sharp: Add check for null before calling Structure.FreeNative
Sebastian Dröge
slomo at kemper.freedesktop.org
Fri May 22 10:02:13 PDT 2009
Module: gstreamer-sharp
Branch: master
Commit: d957255ae12b0e5bb1479992c59e2fd83e0460ee
URL: http://cgit.freedesktop.org/gstreamer/gstreamer-sharp/commit/?id=d957255ae12b0e5bb1479992c59e2fd83e0460ee
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date: Fri May 22 15:59:15 2009 +0200
Add check for null before calling Structure.FreeNative
---
gstreamer-sharp/Event.custom | 3 ++-
gstreamer-sharp/Message.custom | 3 ++-
gstreamer-sharp/Query.custom | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/gstreamer-sharp/Event.custom b/gstreamer-sharp/Event.custom
index dc2f666..cdb7dd1 100644
--- a/gstreamer-sharp/Event.custom
+++ b/gstreamer-sharp/Event.custom
@@ -86,7 +86,8 @@ public Gst.Structure Structure {
IntPtr raw_ret = gst_event_get_structure (Handle);
Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
- ret.FreeNative = false;
+ if (ret != null)
+ ret.FreeNative = false;
cached_structure = ret;
return ret;
}
diff --git a/gstreamer-sharp/Message.custom b/gstreamer-sharp/Message.custom
index 2d5de62..711ca5b 100644
--- a/gstreamer-sharp/Message.custom
+++ b/gstreamer-sharp/Message.custom
@@ -86,7 +86,8 @@ public Gst.Structure Structure {
IntPtr raw_ret = gst_message_get_structure (Handle);
Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
- ret.FreeNative = false;
+ if (ret != null)
+ ret.FreeNative = false;
cached_structure = ret;
return ret;
}
diff --git a/gstreamer-sharp/Query.custom b/gstreamer-sharp/Query.custom
index c7dda85..086118f 100644
--- a/gstreamer-sharp/Query.custom
+++ b/gstreamer-sharp/Query.custom
@@ -12,7 +12,8 @@ public Gst.Structure Structure {
IntPtr raw_ret = gst_query_get_structure (Handle);
Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
- ret.FreeNative = false;
+ if (ret != null)
+ ret.FreeNative = false;
cached_structure = ret;
return ret;
}
More information about the Gstreamer-commits
mailing list