@@ -80,6 +80,9 @@ initialize :: Int -> IO MutableFdCache
8080initialize duration = do
8181 mfc <- newMutableFdCache
8282 tid <- forkIO $ loop mfc
83+ -- Registering finalizer to this IORef.
84+ -- When Warp is finished in GHCi, this IORef is GCed.
85+ -- At that time, we should close all opened file descriptors.
8386 _ <- mkWeakIORef (unMutableFdCache mfc) $ terminate mfc tid
8487 return mfc
8588 where