From df0602723dcb0dd9a558aba9b29cdde8e7c4f6c9 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 10 Sep 2014 15:41:53 +0000 Subject: now release the FunPtr:s that are allocated for each literal callback --- src/runtime/haskell-bind/PGF2.hsc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/runtime/haskell-bind/PGF2.hsc') diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index 7910ece81..ad7deb1b1 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -267,8 +267,7 @@ addLiteral :: Concr -> String -> (Int -> String -> Int -> Maybe (Expr,Float,Int) addLiteral lang cat match = withCString cat $ \ccat -> withGuPool $ \tmp_pool -> do - pool <- pgf_concr_get_pool (concr lang) - callback <- gu_malloc pool (#size PgfLiteralCallback) + callback <- hspgf_new_literal_callback (concr lang) match <- wrapLiteralMatchCallback match_callback predict <- wrapLiteralPredictCallback predict_callback (#poke PgfLiteralCallback, match) callback match @@ -283,7 +282,7 @@ addLiteral lang cat match = msg <- peekCString c_msg throwIO (PGFError msg) else throwIO (PGFError "The literal cannot be added") - else do return () + else return () where match_callback _ clin_idx csentence poffset out_pool = do sentence <- peekCString csentence -- cgit v1.2.3