mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
fixed memory leak in the Haskell binding to the C runtime
This commit is contained in:
@@ -76,6 +76,7 @@ languages p =
|
|||||||
do fptr <- wrapMapItorCallback (getLanguages ref)
|
do fptr <- wrapMapItorCallback (getLanguages ref)
|
||||||
(#poke GuMapItor, fn) itor fptr
|
(#poke GuMapItor, fn) itor fptr
|
||||||
pgf_iter_languages (pgf p) itor nullPtr
|
pgf_iter_languages (pgf p) itor nullPtr
|
||||||
|
freeHaskellFunPtr fptr
|
||||||
readIORef ref
|
readIORef ref
|
||||||
where
|
where
|
||||||
getLanguages :: IORef (Map.Map String Concr) -> MapItorCallback
|
getLanguages :: IORef (Map.Map String Concr) -> MapItorCallback
|
||||||
@@ -171,6 +172,7 @@ lookupMorpho (Concr concr master) sent = unsafePerformIO $
|
|||||||
(#poke PgfMorphoCallback, callback) cback fptr
|
(#poke PgfMorphoCallback, callback) cback fptr
|
||||||
withCString sent $ \c_sent ->
|
withCString sent $ \c_sent ->
|
||||||
pgf_lookup_morpho concr c_sent cback nullPtr
|
pgf_lookup_morpho concr c_sent cback nullPtr
|
||||||
|
freeHaskellFunPtr fptr
|
||||||
readIORef ref
|
readIORef ref
|
||||||
|
|
||||||
fullFormLexicon :: Concr -> [(String, [MorphoAnalysis])]
|
fullFormLexicon :: Concr -> [(String, [MorphoAnalysis])]
|
||||||
|
|||||||
Reference in New Issue
Block a user