mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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] {
|
public object this[string property] {
|
||||||
get {
|
get {
|
||||||
if (PropertyExists (property)) {
|
if (PropertyExists (property)) {
|
||||||
GLib.Value v = GetProperty (property);
|
using (GLib.Value v = GetProperty (property)) {
|
||||||
object o = v.Val;
|
return v.Val;
|
||||||
v.Dispose ();
|
}
|
||||||
return o;
|
|
||||||
} else
|
} else
|
||||||
throw new PropertyNotFoundException ();
|
throw new PropertyNotFoundException ();
|
||||||
} set {
|
} set {
|
||||||
if (PropertyExists (property)) {
|
if (PropertyExists (property)) {
|
||||||
GLib.Value v = new GLib.Value (this, property);
|
using (GLib.Value v = new GLib.Value (this, property)) {
|
||||||
v.Val = value;
|
v.Val = value;
|
||||||
SetProperty (property, v);
|
SetProperty (property, v);
|
||||||
v.Dispose ();
|
}
|
||||||
} else
|
} else
|
||||||
throw new PropertyNotFoundException ();
|
throw new PropertyNotFoundException ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue