From 6b886b90ac5da230e9bc28d6d20f6023cd7f8208 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Thu, 10 Oct 2013 22:52:33 +0200 Subject: [PATCH] Gst.Object: Fixed property existance check g_object_class_find_property's return value does not need to be freed and needs a GObjectClass* --- sources/custom/Object.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sources/custom/Object.cs b/sources/custom/Object.cs index 1339002b3c..a9ddaa682b 100644 --- a/sources/custom/Object.cs +++ b/sources/custom/Object.cs @@ -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