summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gi/pygi-closure.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c
index 919365a3..5916ec99 100644
--- a/gi/pygi-closure.c
+++ b/gi/pygi-closure.c
@@ -24,6 +24,10 @@
#include "pygi-ccallback.h"
#include "pygi-info.h"
+#ifndef GI_CHECK_VERSION
+#define GI_CHECK_VERSION(x,y,z) 0
+#endif
+
extern PyObject *_PyGIDefaultArgPlaceholder;
typedef struct _PyGICallbackCache
@@ -632,8 +636,13 @@ end:
void _pygi_invoke_closure_free (PyGICClosure* invoke_closure)
{
+#if GI_CHECK_VERSION(1, 72, 0)
+ g_callable_info_destroy_closure (invoke_closure->info,
+ invoke_closure->closure);
+#else
g_callable_info_free_closure (invoke_closure->info,
invoke_closure->closure);
+#endif
if (invoke_closure->info)
g_base_info_unref ( (GIBaseInfo*) invoke_closure->info);
@@ -671,8 +680,13 @@ _pygi_make_native_closure (GICallableInfo* info,
Py_XINCREF (closure->user_data);
fficlosure =
+#if GI_CHECK_VERSION(1, 72, 0)
+ g_callable_info_create_closure (info, &closure->cif, _pygi_closure_handle,
+ closure);
+#else
g_callable_info_prepare_closure (info, &closure->cif, _pygi_closure_handle,
closure);
+#endif
closure->closure = fficlosure;
/* Give the closure the information it needs to determine when