diff --git a/Data/JsonStream/Parser.hs b/Data/JsonStream/Parser.hs index 0b05424..febc968 100644 --- a/Data/JsonStream/Parser.hs +++ b/Data/JsonStream/Parser.hs @@ -237,11 +237,11 @@ array' valparse = Parser $ \tp -> (TokFailed) -> Failed "Array - token failed" where nextitem _ _ (ArrayEnd ctx) ntok = Done ctx ntok - nextitem i tok _ _ = arrcontent i (callParse (valparse i) tok) + nextitem !i tok _ _ = arrcontent i (callParse (valparse i) tok) - arrcontent i (Done _ ntp) = moreData (nextitem (i+1)) ntp - arrcontent i (MoreData (Parser np, ntp)) = MoreData (Parser (arrcontent i . np), ntp) - arrcontent i (Yield v np) = Yield v (arrcontent i np) + arrcontent !i (Done _ ntp) = moreData (nextitem (i+1)) ntp + arrcontent !i (MoreData (Parser np, ntp)) = MoreData (Parser (arrcontent i . np), ntp) + arrcontent !i (Yield v np) = Yield v (arrcontent i np) arrcontent _ (Failed err) = Failed err -- | Match all items of an array. diff --git a/changelog.md b/changelog.md index 8065f45..653b97d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +# 0.4.1.1 +Fixed memory leak in arrayOf + # 0.4.1.0 Added aeson-compatibile encode/decode functions. diff --git a/json-stream.cabal b/json-stream.cabal index abfa9ea..4a2084d 100644 --- a/json-stream.cabal +++ b/json-stream.cabal @@ -1,5 +1,5 @@ name: json-stream -version: 0.4.1.0 +version: 0.4.1.1 synopsis: Incremental applicative JSON parser description: Easy to use JSON parser fully supporting incremental parsing. Parsing grammar in applicative form.