From 21e855c91d5689aa34b48fd7188da984060b40d5 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 16 Jun 2014 08:49:13 +0000 Subject: [PATCH] fixed memory leak in the Haskell binding to the C runtime --- src/runtime/haskell-bind/PGF2.hsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index 56f7c0c13..f6bfce25e 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -76,6 +76,7 @@ languages p = do fptr <- wrapMapItorCallback (getLanguages ref) (#poke GuMapItor, fn) itor fptr pgf_iter_languages (pgf p) itor nullPtr + freeHaskellFunPtr fptr readIORef ref where getLanguages :: IORef (Map.Map String Concr) -> MapItorCallback @@ -171,6 +172,7 @@ lookupMorpho (Concr concr master) sent = unsafePerformIO $ (#poke PgfMorphoCallback, callback) cback fptr withCString sent $ \c_sent -> pgf_lookup_morpho concr c_sent cback nullPtr + freeHaskellFunPtr fptr readIORef ref fullFormLexicon :: Concr -> [(String, [MorphoAnalysis])]