diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-04-22 12:40:17 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-04-22 12:40:17 +0200 |
commit | 53ff4800607508ce1c533ab7165f6dccc0c0303f (patch) | |
tree | 07a906fa7abe46f411e3fe5adb7558fae0dfc3b0 | |
parent | 5278dd648659c1e4f43bb8b0738659772e7a1461 (diff) |
Dispose some more GLib.Values after usage
-rw-r--r-- | gstreamer-sharp/Structure.custom | 8 | ||||
-rw-r--r-- | gstreamer-sharp/TagList.custom | 1 | ||||
-rw-r--r-- | gstreamer-sharp/Value.cs | 8 |
3 files changed, 15 insertions, 2 deletions
diff --git a/gstreamer-sharp/Structure.custom b/gstreamer-sharp/Structure.custom index 43af59d..1a3d930 100644 --- a/gstreamer-sharp/Structure.custom +++ b/gstreamer-sharp/Structure.custom @@ -158,7 +158,9 @@ public object Get (string field) { } public void Set (string field, object value) { - SetValue (field, new GLib.Value (value)); + GLib.Value v = new GLib.Value (value); + SetValue (field, v); + v.Dispose (); } public void Set (params object[] fields) { @@ -171,7 +173,9 @@ public void Set (params object[] fields) { if (fields[i].GetType () != typeof (string)) throw new ArgumentException (); - SetValue (fields[i] as string, new GLib.Value (fields[i+1])); + GLib.Value v = new GLib.Value (fields[i+1]); + SetValue (fields[i] as string, v); + v.Dispose (); } } diff --git a/gstreamer-sharp/TagList.custom b/gstreamer-sharp/TagList.custom index 3a0405c..f8ebd5a 100644 --- a/gstreamer-sharp/TagList.custom +++ b/gstreamer-sharp/TagList.custom @@ -68,6 +68,7 @@ public void Add (Gst.TagMergeMode mode, string tag, object value) { IntPtr raw_string = GLib.Marshaller.StringToPtrGStrdup (tag); gstsharp_gst_tag_list_add_value (Handle, mode, raw_string, ref v); + v.Dispose (); GLib.Marshaller.Free (raw_string); } diff --git a/gstreamer-sharp/Value.cs b/gstreamer-sharp/Value.cs index f45cba0..bd888bd 100644 --- a/gstreamer-sharp/Value.cs +++ b/gstreamer-sharp/Value.cs @@ -269,6 +269,8 @@ namespace Gst { GLib.Value min = new GLib.Value (Min); GLib.Value max = new GLib.Value (Max); gst_value_set_fraction_range (ref val, ref min, ref max); + min.Dispose (); + max.Dispose (); } public override string ToString () { @@ -281,6 +283,8 @@ namespace Gst { GLib.Value min = new GLib.Value (range.Min); GLib.Value max = new GLib.Value (range.Max); gst_value_set_fraction_range (ref val, ref min, ref max); + min.Dispose (); + max.Dispose (); return val; } @@ -469,6 +473,7 @@ namespace Gst { foreach (object o in content) { GLib.Value v = new GLib.Value (o); gst_value_list_append_value (ref val, ref v); + v.Dispose (); } } @@ -492,6 +497,7 @@ namespace Gst { foreach (object o in l.content) { GLib.Value v = new GLib.Value (o); gst_value_list_append_value (ref val, ref v); + v.Dispose (); } return val; @@ -552,6 +558,7 @@ namespace Gst { foreach (object o in content) { GLib.Value v = new GLib.Value (o); gst_value_array_append_value (ref val, ref v); + v.Dispose (); } } @@ -561,6 +568,7 @@ namespace Gst { foreach (object o in a.content) { GLib.Value v = new GLib.Value (o); gst_value_array_append_value (ref val, ref v); + v.Dispose (); } return val; |