diff options
author | defanor <defanor@uberspace.net> | 2018-02-23 18:33:50 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2018-02-23 18:39:36 +0300 |
commit | 994485a855267dda40f6d656c33f4ec68903fda8 (patch) | |
tree | 90e8074b6752f850c4916d75e90d16522305a0fd /Text/Pandoc | |
parent | 339a7f006527ad1f1e5b499bc620dd020e796df7 (diff) |
Force the triples with deepseq
Not quite sure if it's the proper fix, but appears to fix an
occasional segfault on RDF reading.
Diffstat (limited to 'Text/Pandoc')
-rw-r--r-- | Text/Pandoc/Readers/RDF.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Text/Pandoc/Readers/RDF.hs b/Text/Pandoc/Readers/RDF.hs index 23d3ca7..0d9aa26 100644 --- a/Text/Pandoc/Readers/RDF.hs +++ b/Text/Pandoc/Readers/RDF.hs @@ -48,6 +48,7 @@ import System.Directory ( getXdgDirectory, XdgDirectory(..) , createDirectoryIfMissing ) import Control.Monad (zipWithM) import Data.Maybe (mapMaybe) +import Control.DeepSeq import Redland @@ -157,8 +158,9 @@ readRDF bu rf t = do cacheDir <- getXdgDirectory XdgCache "pancake" createDirectoryIfMissing True cacheDir withWSMU "hashes" [("hash-type", "bdb"), ("dir", cacheDir)] - "rdf-cache" "" (uriToString id bu "") $ \world' _ model' _ -> - mapM (readTriple (world', model')) $ prepareTriples triples + "rdf-cache" "" (uriToString id bu "") $ \world' _ model' _ -> do + r <- mapM (readTriple (world', model')) $ prepareTriples triples + r `deepseq` pure r readTriple :: ( ForeignPtr RedlandWorld , ForeignPtr RedlandModel) -> Triple @@ -170,3 +172,4 @@ readRDF bu rf t = do -- rdfproc rdf-cache parse http://xmlns.com/foaf/0.1/ -- rdfproc rdf-cache parse http://www.w3.org/1999/02/22-rdf-syntax-ns +-- rdfproc rdf-cache parse http://www.w3.org/2000/01/rdf-schema |