mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
Dispose some more GLib.Values after usage
This commit is contained in:
parent
5278dd6486
commit
53ff480060
3 changed files with 15 additions and 2 deletions
|
@ -158,7 +158,9 @@ public object Get (string field) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set (string field, object value) {
|
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) {
|
public void Set (params object[] fields) {
|
||||||
|
@ -171,7 +173,9 @@ public void Set (params object[] fields) {
|
||||||
if (fields[i].GetType () != typeof (string))
|
if (fields[i].GetType () != typeof (string))
|
||||||
throw new ArgumentException ();
|
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 ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ public void Add (Gst.TagMergeMode mode, string tag, object value) {
|
||||||
|
|
||||||
IntPtr raw_string = GLib.Marshaller.StringToPtrGStrdup (tag);
|
IntPtr raw_string = GLib.Marshaller.StringToPtrGStrdup (tag);
|
||||||
gstsharp_gst_tag_list_add_value (Handle, mode, raw_string, ref v);
|
gstsharp_gst_tag_list_add_value (Handle, mode, raw_string, ref v);
|
||||||
|
v.Dispose ();
|
||||||
GLib.Marshaller.Free (raw_string);
|
GLib.Marshaller.Free (raw_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,8 @@ namespace Gst {
|
||||||
GLib.Value min = new GLib.Value (Min);
|
GLib.Value min = new GLib.Value (Min);
|
||||||
GLib.Value max = new GLib.Value (Max);
|
GLib.Value max = new GLib.Value (Max);
|
||||||
gst_value_set_fraction_range (ref val, ref min, ref max);
|
gst_value_set_fraction_range (ref val, ref min, ref max);
|
||||||
|
min.Dispose ();
|
||||||
|
max.Dispose ();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString () {
|
public override string ToString () {
|
||||||
|
@ -281,6 +283,8 @@ namespace Gst {
|
||||||
GLib.Value min = new GLib.Value (range.Min);
|
GLib.Value min = new GLib.Value (range.Min);
|
||||||
GLib.Value max = new GLib.Value (range.Max);
|
GLib.Value max = new GLib.Value (range.Max);
|
||||||
gst_value_set_fraction_range (ref val, ref min, ref max);
|
gst_value_set_fraction_range (ref val, ref min, ref max);
|
||||||
|
min.Dispose ();
|
||||||
|
max.Dispose ();
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,6 +473,7 @@ namespace Gst {
|
||||||
foreach (object o in content) {
|
foreach (object o in content) {
|
||||||
GLib.Value v = new GLib.Value (o);
|
GLib.Value v = new GLib.Value (o);
|
||||||
gst_value_list_append_value (ref val, ref v);
|
gst_value_list_append_value (ref val, ref v);
|
||||||
|
v.Dispose ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,6 +497,7 @@ namespace Gst {
|
||||||
foreach (object o in l.content) {
|
foreach (object o in l.content) {
|
||||||
GLib.Value v = new GLib.Value (o);
|
GLib.Value v = new GLib.Value (o);
|
||||||
gst_value_list_append_value (ref val, ref v);
|
gst_value_list_append_value (ref val, ref v);
|
||||||
|
v.Dispose ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
|
@ -552,6 +558,7 @@ namespace Gst {
|
||||||
foreach (object o in content) {
|
foreach (object o in content) {
|
||||||
GLib.Value v = new GLib.Value (o);
|
GLib.Value v = new GLib.Value (o);
|
||||||
gst_value_array_append_value (ref val, ref v);
|
gst_value_array_append_value (ref val, ref v);
|
||||||
|
v.Dispose ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,6 +568,7 @@ namespace Gst {
|
||||||
foreach (object o in a.content) {
|
foreach (object o in a.content) {
|
||||||
GLib.Value v = new GLib.Value (o);
|
GLib.Value v = new GLib.Value (o);
|
||||||
gst_value_array_append_value (ref val, ref v);
|
gst_value_array_append_value (ref val, ref v);
|
||||||
|
v.Dispose ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
|
|
Loading…
Reference in a new issue