Add check for null before calling Structure.FreeNative

This commit is contained in:
Maarten Bosmans 2009-05-22 15:59:15 +02:00 committed by Sebastian Dröge
parent 61523d6d5a
commit d957255ae1
3 changed files with 6 additions and 3 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}