diff --git a/Data/GI/Base/Utils.hsc b/Data/GI/Base/Utils.hsc
--- a/Data/GI/Base/Utils.hsc
+++ b/Data/GI/Base/Utils.hsc
@@ -21,6 +21,7 @@
     , memcpy
     , safeFreeFunPtr
     , safeFreeFunPtrPtr
+    , safeFreeFunPtrPtr'
     , maybeReleaseFunPtr
     , checkUnexpectedReturnNULL
     , checkUnexpectedNothing
@@ -171,6 +172,12 @@
 -- | A pointer to `safeFreeFunPtr`.
 foreign import ccall "& safeFreeFunPtr" safeFreeFunPtrPtr ::
     FunPtr (Ptr a -> IO ())
+
+-- | Similar to 'safeFreeFunPtrPtr', but accepts an additional
+-- (ignored) argument. The first argument is interpreted as a
+-- 'FunPtr', and released.
+foreign import ccall "& safeFreeFunPtr2" safeFreeFunPtrPtr' ::
+    FunPtr (Ptr a -> Ptr b -> IO ())
 
 -- | If given a pointer to the memory location, free the `FunPtr` at
 -- that location, and then the pointer itself. Useful for freeing the
diff --git a/c/hsgclosure.c b/c/hsgclosure.c
--- a/c/hsgclosure.c
+++ b/c/hsgclosure.c
@@ -277,6 +277,12 @@
     freeHaskellFunctionPtr(ptr);
 }
 
+/* Same as safeFreeFunPtr, but it accepts (but ignores) an extra argument */
+void safeFreeFunPtr2(void *ptr, void *unused)
+{
+  safeFreeFunPtr(ptr);
+}
+
 /* Returns the GType associated to a class instance */
 GType haskell_gi_gtype_from_class (gpointer klass)
 {
diff --git a/haskell-gi-base.cabal b/haskell-gi-base.cabal
--- a/haskell-gi-base.cabal
+++ b/haskell-gi-base.cabal
@@ -1,5 +1,5 @@
 name:                haskell-gi-base
-version:             0.24.4
+version:             0.24.5
 synopsis:            Foundation for libraries generated by haskell-gi
 description:         Foundation for libraries generated by haskell-gi
 homepage:            https://github.com/haskell-gi/haskell-gi
