on master help sign in
Allow ByteString that is the result of serialization to be freed

Fixes snoyberg/yaml#232

commit5f5462d3bda74bc4627c9372e905565a9c58a62f authormniip <mniip@users.noreply.github.com> dateSun 5 Apr 2026, 05:12 (6 months ago) parent7380d7f
1 file changed+1−1
unifiedsplit
libyaml/src/Text/Libyaml.hs+1−1
libyaml/src/Text/Libyaml.hs+1−1
@@ -776,7 +776,7 @@ encodeWith opts =
776776 close _ fbuf = withForeignPtr fbuf $ \b -> do
777777 ptr' <- c_get_buffer_buff b
778778 len <- c_get_buffer_used b
779− fptr <- newForeignPtr_ $ castPtr ptr'
779+ fptr <- newForeignPtr finalizerFree $ castPtr ptr'
780780 return $ B.fromForeignPtr fptr 0 $ fromIntegral len
781781
782782