From f77269c4808549038db4fa3a260e7403d87f1e9e Mon Sep 17 00:00:00 2001 From: Cimbali Date: Mon, 1 Nov 2021 19:31:58 +0100 Subject: [PATCH] Avoid leaking memory from FFI closure if no segfault risk --- girffi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/girffi.c b/girffi.c index 851651321..4cf139d07 100644 --- a/girffi.c +++ b/girffi.c @@ -494,4 +494,7 @@ g_callable_info_prepare_closure (GICallableInfo *callable_info, void g_callable_info_free_closure (GICallableInfo *callable_info, ffi_closure *closure) { g_warning ("g_callable_info_free_closure is deprecated and leaks memory\n"); +#ifdef LEGACY_GIRFFI_FREE + g_callable_info_destroy_closure(callable_info, closure); +#endif }