aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-08-14 01:32:15 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-08-14 01:32:15 +0000
commit8388427d230e853466298cfae7abf0ac0af50269 (patch)
treeeb9767b8d9c90a384af80ab5edcf847521864d61
parentf53fb554fe0acf88d7c697236bbd1373e78f3d83 (diff)
downloadpandoc-8388427d230e853466298cfae7abf0ac0af50269.tar.gz
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
-rw-r--r--Text/Pandoc/PDF.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Text/Pandoc/PDF.hs b/Text/Pandoc/PDF.hs
index dc8e49df1..4257e4712 100644
--- a/Text/Pandoc/PDF.hs
+++ b/Text/Pandoc/PDF.hs
@@ -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