From a7ac9ee4fbbc59666b56361a2f5039339a639d5d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sun, 9 Jun 2019 12:16:28 -0400 Subject: [PATCH] Fix gst_promise_new_with_change_func For some reason bindinator doesn't properly detect that the `func` passed in gst_promise_new_with_change_func is a closure and what the destroy function is (because it is a constructor?) Mark it manually. From suggestion from Alex Dircksen: https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/issues/9#note_166633 Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/issues/9 --- sources/generated/Gst/Promise.cs | 11 ++++++++++- sources/generated/gstreamer-sharp-api.xml | 2 +- sources/gstreamer-sharp.metadata | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sources/generated/Gst/Promise.cs b/sources/generated/Gst/Promise.cs index c41e7f8f6a..857402a57f 100644 --- a/sources/generated/Gst/Promise.cs +++ b/sources/generated/Gst/Promise.cs @@ -75,9 +75,18 @@ namespace Gst { [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr gst_promise_new_with_change_func(GstSharp.PromiseChangeFuncNative func, IntPtr user_data, GLib.DestroyNotify notify); - public Promise (Gst.PromiseChangeFunc func, IntPtr user_data, GLib.DestroyNotify notify) + public Promise (Gst.PromiseChangeFunc func) { GstSharp.PromiseChangeFuncWrapper func_wrapper = new GstSharp.PromiseChangeFuncWrapper (func); + IntPtr user_data; + GLib.DestroyNotify notify; + if (func == null) { + user_data = IntPtr.Zero; + notify = null; + } else { + user_data = (IntPtr) GCHandle.Alloc (func_wrapper); + notify = GLib.DestroyHelper.NotifyHandler; + } Raw = gst_promise_new_with_change_func(func_wrapper.NativeDelegate, user_data, notify); } diff --git a/sources/generated/gstreamer-sharp-api.xml b/sources/generated/gstreamer-sharp-api.xml index 259e4ac6e9..6195792165 100644 --- a/sources/generated/gstreamer-sharp-api.xml +++ b/sources/generated/gstreamer-sharp-api.xml @@ -9060,7 +9060,7 @@ - + diff --git a/sources/gstreamer-sharp.metadata b/sources/gstreamer-sharp.metadata index e25957a7e0..fa74b36ffa 100644 --- a/sources/gstreamer-sharp.metadata +++ b/sources/gstreamer-sharp.metadata @@ -39,6 +39,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA RetrieveReply + notified + 1 + 2 + true