vty 5.24.1 → 5.25
raw patch · 3 files changed
+13/−4 lines, 3 files
Files
- CHANGELOG.md +6/−0
- src/Graphics/Vty.hs +6/−3
- vty.cabal +1/−1
CHANGELOG.md view
@@ -1,4 +1,10 @@ +5.25+ - The Vty type got a new field, isShutdown, that returns whether the+ Vty handle has had its 'shutdown' function called (thanks Ian+ Jeffries)+ - Vty's shutdown function is now thread-safe.+ 5.24.1 - The "shutdown" method of Vty handles is now idempotent (#159)
src/Graphics/Vty.hs view
@@ -94,8 +94,9 @@ -- | Clean up after vty. A call to this function is necessary to -- cleanly restore the terminal state before application exit. The -- above methods will throw an exception if executed after this is- -- executed.+ -- executed. Idempotent. , shutdown :: IO ()+ , isShutdown :: IO Bool } -- | Create a Vty handle. At most one handle should be created at a time@@ -119,13 +120,14 @@ shutdownVar <- atomically $ newTVar False let shutdownIo = do- alreadyShutdown <- atomically $ readTVar shutdownVar+ alreadyShutdown <- atomically $ swapTVar shutdownVar True when (not alreadyShutdown) $ do- atomically $ writeTVar shutdownVar True shutdownInput input releaseDisplay out releaseTerminal out + let shutdownStatus = atomically $ readTVar shutdownVar+ lastPicRef <- newIORef Nothing lastUpdateRef <- newIORef Nothing @@ -176,4 +178,5 @@ , outputIface = out , refresh = innerRefresh , shutdown = shutdownIo+ , isShutdown = shutdownStatus }
vty.cabal view
@@ -1,5 +1,5 @@ name: vty-version: 5.24.1+version: 5.25 license: BSD3 license-file: LICENSE author: AUTHORS