mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
Gst.Object: use 'using' pattern for GValue
This commit is contained in:
parent
d4edf8050d
commit
6f9a3c777e
1 changed files with 7 additions and 8 deletions
|
@ -48,18 +48,17 @@ namespace Gst {
|
|||
public object this[string property] {
|
||||
get {
|
||||
if (PropertyExists (property)) {
|
||||
GLib.Value v = GetProperty (property);
|
||||
object o = v.Val;
|
||||
v.Dispose ();
|
||||
return o;
|
||||
using (GLib.Value v = GetProperty (property)) {
|
||||
return v.Val;
|
||||
}
|
||||
} else
|
||||
throw new PropertyNotFoundException ();
|
||||
} set {
|
||||
if (PropertyExists (property)) {
|
||||
GLib.Value v = new GLib.Value (this, property);
|
||||
v.Val = value;
|
||||
SetProperty (property, v);
|
||||
v.Dispose ();
|
||||
using (GLib.Value v = new GLib.Value (this, property)) {
|
||||
v.Val = value;
|
||||
SetProperty (property, v);
|
||||
}
|
||||
} else
|
||||
throw new PropertyNotFoundException ();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue