Skip to content

Commit bae3f0d

Browse files
committed
use bracket
1 parent 57af456 commit bae3f0d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,11 +924,10 @@ indexHieFile se mod_summary srcPath !hash hf = do
924924
-- If the hash in the pending list doesn't match the current hash, then skip
925925
Just pendingHash -> pendingHash /= hash
926926
unless newerScheduled $ do
927-
-- Using `finally`, so even if an exception happen during withHieDb call,
927+
-- Using `bracket`, so even if an exception happen during withHieDb call,
928928
-- the the ending part of `reportProgress` (which clean the progress indicator) will still be called.
929929
indexDoneB <- liftIO newBarrier
930-
_ <- liftIO $ async (reportProgress indexDoneB optProgressStyle)
931-
flip finally (signalBarrier indexDoneB ()) $
930+
bracket_ (liftIO $ async (reportProgress indexDoneB optProgressStyle)) (signalBarrier indexDoneB ()) $
932931
withHieDb (\db -> HieDb.addRefsFromLoaded db targetPath (HieDb.RealFile $ fromNormalizedFilePath srcPath) hash hf')
933932
where
934933
mod_location = ms_location mod_summary

0 commit comments

Comments
 (0)