diff --git a/GI/Soup/Functions.hs b/GI/Soup/Functions.hs
--- a/GI/Soup/Functions.hs
+++ b/GI/Soup/Functions.hs
@@ -334,8 +334,7 @@
         result' <- cstringToText result
         freeMem result
         params' <- peek params
-        -- XXX Wrapping a foreign struct/union with no known destructor, leak?
-        params'' <- (\x -> XMLRPCParams <$> newForeignPtr_ x) params'
+        params'' <- (wrapPtr XMLRPCParams) params'
         freeMem methodCall'
         freeMem params
         return (result', params'')
diff --git a/GI/Soup/Structs/Connection.hs b/GI/Soup/Structs/Connection.hs
--- a/GI/Soup/Structs/Connection.hs
+++ b/GI/Soup/Structs/Connection.hs
@@ -27,6 +27,12 @@
 import GI.Soup.Callbacks
 
 newtype Connection = Connection (ForeignPtr Connection)
+-- XXX Wrapping a foreign struct/union with no known destructor or size, leak?
+instance WrappedPtr Connection where
+    wrappedPtrCalloc = return nullPtr
+    wrappedPtrCopy = return
+    wrappedPtrFree = Nothing
+
 noConnection :: Maybe Connection
 noConnection = Nothing
 
diff --git a/GI/Soup/Structs/Connection.hs-boot b/GI/Soup/Structs/Connection.hs-boot
--- a/GI/Soup/Structs/Connection.hs-boot
+++ b/GI/Soup/Structs/Connection.hs-boot
@@ -8,3 +8,4 @@
 import qualified Data.Map as Map
 
 newtype Connection = Connection (ForeignPtr Connection)
+instance WrappedPtr Connection where
diff --git a/GI/Soup/Structs/MessageHeadersIter.hs b/GI/Soup/Structs/MessageHeadersIter.hs
--- a/GI/Soup/Structs/MessageHeadersIter.hs
+++ b/GI/Soup/Structs/MessageHeadersIter.hs
@@ -49,9 +49,14 @@
 import GI.Soup.Callbacks
 
 newtype MessageHeadersIter = MessageHeadersIter (ForeignPtr MessageHeadersIter)
+instance WrappedPtr MessageHeadersIter where
+    wrappedPtrCalloc = callocBytes 24
+    wrappedPtrCopy = copyPtr 24
+    wrappedPtrFree = Just ptr_to_g_free
+
 -- | Construct a `MessageHeadersIter` struct initialized to zero.
 newZeroMessageHeadersIter :: MonadIO m => m MessageHeadersIter
-newZeroMessageHeadersIter = liftIO $ callocBytes 24 >>= wrapPtr MessageHeadersIter
+newZeroMessageHeadersIter = liftIO $ wrappedPtrCalloc >>= wrapPtr MessageHeadersIter
 
 instance tag ~ 'AttrSet => Constructible MessageHeadersIter tag where
     new _ attrs = do
diff --git a/GI/Soup/Structs/MessageHeadersIter.hs-boot b/GI/Soup/Structs/MessageHeadersIter.hs-boot
--- a/GI/Soup/Structs/MessageHeadersIter.hs-boot
+++ b/GI/Soup/Structs/MessageHeadersIter.hs-boot
@@ -8,4 +8,5 @@
 import qualified Data.Map as Map
 
 newtype MessageHeadersIter = MessageHeadersIter (ForeignPtr MessageHeadersIter)
+instance WrappedPtr MessageHeadersIter where
 data MessageHeadersIterNextMethodInfo
diff --git a/GI/Soup/Structs/MessageQueue.hs b/GI/Soup/Structs/MessageQueue.hs
--- a/GI/Soup/Structs/MessageQueue.hs
+++ b/GI/Soup/Structs/MessageQueue.hs
@@ -27,6 +27,12 @@
 import GI.Soup.Callbacks
 
 newtype MessageQueue = MessageQueue (ForeignPtr MessageQueue)
+-- XXX Wrapping a foreign struct/union with no known destructor or size, leak?
+instance WrappedPtr MessageQueue where
+    wrappedPtrCalloc = return nullPtr
+    wrappedPtrCopy = return
+    wrappedPtrFree = Nothing
+
 noMessageQueue :: Maybe MessageQueue
 noMessageQueue = Nothing
 
diff --git a/GI/Soup/Structs/MessageQueue.hs-boot b/GI/Soup/Structs/MessageQueue.hs-boot
--- a/GI/Soup/Structs/MessageQueue.hs-boot
+++ b/GI/Soup/Structs/MessageQueue.hs-boot
@@ -8,3 +8,4 @@
 import qualified Data.Map as Map
 
 newtype MessageQueue = MessageQueue (ForeignPtr MessageQueue)
+instance WrappedPtr MessageQueue where
diff --git a/GI/Soup/Structs/MessageQueueItem.hs b/GI/Soup/Structs/MessageQueueItem.hs
--- a/GI/Soup/Structs/MessageQueueItem.hs
+++ b/GI/Soup/Structs/MessageQueueItem.hs
@@ -27,6 +27,12 @@
 import GI.Soup.Callbacks
 
 newtype MessageQueueItem = MessageQueueItem (ForeignPtr MessageQueueItem)
+-- XXX Wrapping a foreign struct/union with no known destructor or size, leak?
+instance WrappedPtr MessageQueueItem where
+    wrappedPtrCalloc = return nullPtr
+    wrappedPtrCopy = return
+    wrappedPtrFree = Nothing
+
 noMessageQueueItem :: Maybe MessageQueueItem
 noMessageQueueItem = Nothing
 
diff --git a/GI/Soup/Structs/MessageQueueItem.hs-boot b/GI/Soup/Structs/MessageQueueItem.hs-boot
--- a/GI/Soup/Structs/MessageQueueItem.hs-boot
+++ b/GI/Soup/Structs/MessageQueueItem.hs-boot
@@ -8,3 +8,4 @@
 import qualified Data.Map as Map
 
 newtype MessageQueueItem = MessageQueueItem (ForeignPtr MessageQueueItem)
+instance WrappedPtr MessageQueueItem where
diff --git a/GI/Soup/Structs/Range.hs b/GI/Soup/Structs/Range.hs
--- a/GI/Soup/Structs/Range.hs
+++ b/GI/Soup/Structs/Range.hs
@@ -58,9 +58,14 @@
 import GI.Soup.Callbacks
 
 newtype Range = Range (ForeignPtr Range)
+instance WrappedPtr Range where
+    wrappedPtrCalloc = callocBytes 16
+    wrappedPtrCopy = copyPtr 16
+    wrappedPtrFree = Just ptr_to_g_free
+
 -- | Construct a `Range` struct initialized to zero.
 newZeroRange :: MonadIO m => m Range
-newZeroRange = liftIO $ callocBytes 16 >>= wrapPtr Range
+newZeroRange = liftIO $ wrappedPtrCalloc >>= wrapPtr Range
 
 instance tag ~ 'AttrSet => Constructible Range tag where
     new _ attrs = do
diff --git a/GI/Soup/Structs/Range.hs-boot b/GI/Soup/Structs/Range.hs-boot
--- a/GI/Soup/Structs/Range.hs-boot
+++ b/GI/Soup/Structs/Range.hs-boot
@@ -8,3 +8,4 @@
 import qualified Data.Map as Map
 
 newtype Range = Range (ForeignPtr Range)
+instance WrappedPtr Range where
diff --git a/GI/Soup/Structs/XMLRPCParams.hs b/GI/Soup/Structs/XMLRPCParams.hs
--- a/GI/Soup/Structs/XMLRPCParams.hs
+++ b/GI/Soup/Structs/XMLRPCParams.hs
@@ -44,6 +44,12 @@
 import GI.Soup.Callbacks
 
 newtype XMLRPCParams = XMLRPCParams (ForeignPtr XMLRPCParams)
+-- XXX Wrapping a foreign struct/union with no known destructor or size, leak?
+instance WrappedPtr XMLRPCParams where
+    wrappedPtrCalloc = return nullPtr
+    wrappedPtrCopy = return
+    wrappedPtrFree = Nothing
+
 noXMLRPCParams :: Maybe XMLRPCParams
 noXMLRPCParams = Nothing
 
diff --git a/GI/Soup/Structs/XMLRPCParams.hs-boot b/GI/Soup/Structs/XMLRPCParams.hs-boot
--- a/GI/Soup/Structs/XMLRPCParams.hs-boot
+++ b/GI/Soup/Structs/XMLRPCParams.hs-boot
@@ -8,5 +8,6 @@
 import qualified Data.Map as Map
 
 newtype XMLRPCParams = XMLRPCParams (ForeignPtr XMLRPCParams)
+instance WrappedPtr XMLRPCParams where
 data XMLRPCParamsFreeMethodInfo
 data XMLRPCParamsParseMethodInfo
diff --git a/gi-soup.cabal b/gi-soup.cabal
--- a/gi-soup.cabal
+++ b/gi-soup.cabal
@@ -1,6 +1,6 @@
 -- Autogenerated, do not edit.
 name:               gi-soup
-version:            0.2.52.14
+version:            0.2.52.15
 synopsis:           Soup bindings
 description:        Bindings for Soup, autogenerated by haskell-gi.
 homepage:           https://github.com/haskell-gi/haskell-gi
@@ -76,10 +76,10 @@
                         GI.Soup.Structs.XMLRPCParams
     pkgconfig-depends:  libsoup-2.4 >= 2.52
     build-depends: base >= 4.7 && <5,
-        haskell-gi-base >= 0.14 && < 1,
-        gi-glib >= 0.2.46.14 && < 0.2.47,
-        gi-gobject >= 0.2.46.14 && < 0.2.47,
-        gi-gio >= 0.2.46.14 && < 0.2.47,
+        haskell-gi-base >= 0.15 && < 1,
+        gi-glib >= 0.2.46.15 && < 0.2.47,
+        gi-gobject >= 0.2.46.15 && < 0.2.47,
+        gi-gio >= 0.2.46.15 && < 0.2.47,
         bytestring >= 0.10,
         containers >= 0.5,
         text >= 1.0,
