summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2009-05-22 15:59:15 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-05-22 19:01:26 +0200
commitd957255ae12b0e5bb1479992c59e2fd83e0460ee (patch)
treef25e7db59b456bf24a66a51b0eee73501569e954
parent61523d6d5aba0648c0a92ef2d42481ea0115fda6 (diff)
Add check for null before calling Structure.FreeNative
-rw-r--r--gstreamer-sharp/Event.custom3
-rw-r--r--gstreamer-sharp/Message.custom3
-rw-r--r--gstreamer-sharp/Query.custom3
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;
}