PDF writer: Close output file handle after waitForProcess.

It should be closed automatically, but perhaps this fails on Windows,
especially when the process is interrupted?


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1410 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2008-08-14 01:32:15 +00:00
parent f53fb554fe
commit 8388427d23

View file

@ -37,7 +37,7 @@ import System.Exit
import System.Environment ( getEnvironment )
import Text.Pandoc.Shared ( withTempDir )
import Prelude hiding ( writeFile, readFile, putStrLn )
import System.IO ( stderr, openFile, IOMode (..) )
import System.IO ( stderr, openFile, IOMode (..), hClose )
#ifdef _UTF8STRING
import System.IO.UTF8
#else
@ -102,6 +102,7 @@ runProgram cmdPath arguments workingDir env = do
runOutput <- openFile runOutputPath WriteMode
ph <- runProcess cmdPath arguments (Just workingDir) (Just env) Nothing (Just runOutput) (Just runOutput)
ec <- waitForProcess ph -- requires compilation with -threaded
hClose runOutput
case ec of
ExitSuccess -> return []
_ -> do