mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 03:45:39 +00:00
Gst.Object: Fixed property existance check
g_object_class_find_property's return value does not need to be freed and needs a GObjectClass*
This commit is contained in:
parent
6f9a3c777e
commit
6b886b90ac
1 changed files with 1 additions and 3 deletions
|
@ -28,14 +28,12 @@ namespace Gst {
|
|||
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_object_class_find_property (IntPtr klass, IntPtr name);
|
||||
|
||||
|
||||
bool PropertyExists (string name) {
|
||||
if (PropertyNameCache.ContainsKey (name))
|
||||
return PropertyNameCache [name];
|
||||
|
||||
var ptr = g_object_class_find_property (GType.GetClassPtr (), GLib.Marshaller.StringToPtrGStrdup (name));
|
||||
var ptr = g_object_class_find_property (Marshal.ReadIntPtr (Handle), GLib.Marshaller.StringToPtrGStrdup (name));
|
||||
var result = ptr != IntPtr.Zero;
|
||||
GLib.Marshaller.Free (ptr);
|
||||
|
||||
// just cache the positive results because there might
|
||||
// actually be new properties getting installed
|
||||
|
|
Loading…
Reference in a new issue