Commits

Bryan O'Sullivan committed ddebe14

Make sure our chunks remain alive after compression.

Comments (0)

Files changed (1)

Codec/Compression/Snappy/Lazy.hsc

       with (fromIntegral dlen0) $ \dlenPtr -> do
         c_CompressChunks chunkPtr (fromIntegral (length chunks))
                          (fromIntegral len) dptr dlenPtr
+        foldr (\(PS fp _ _) _ -> touchForeignPtr fp) (return ()) chunks
         dlen <- fromIntegral `fmap` peek dlenPtr
         if dlen == 0
           then return Empty