Skip to content

Commit

Permalink
Passing resource to the subsequent conduit correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
maksar authored Apr 25, 2024
1 parent 0deecaa commit 8a4fe46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conduit-extra/Data/Conduit/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ sinkCacheLength = do
(\(fp, h) -> IO.hClose h `finally` removeFile fp)
len <- sinkHandleLen h
liftIO $ IO.hClose h
return (len, CC.sourceFile fp >> release releaseKey)
cleanup <- fromMaybe (pure ()) <$> unprotect releaseKey
return (len, CC.sourceFile fp >> void (register cleanup))
where
sinkHandleLen :: MonadResource m => IO.Handle -> ConduitT S.ByteString o m Word64
sinkHandleLen h =
Expand Down

0 comments on commit 8a4fe46

Please sign in to comment.