diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2014-09-10 15:41:53 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2014-09-10 15:41:53 +0000 |
| commit | df0602723dcb0dd9a558aba9b29cdde8e7c4f6c9 (patch) | |
| tree | 7e363176c26b16f6f56b280153db12af0c254e3f /src/runtime/haskell-bind/PGF2.hsc | |
| parent | 80725e872be76ce713fe34c72f6df42e2dd644ed (diff) | |
now release the FunPtr:s that are allocated for each literal callback
Diffstat (limited to 'src/runtime/haskell-bind/PGF2.hsc')
| -rw-r--r-- | src/runtime/haskell-bind/PGF2.hsc | 5 |
1 files changed, 2 insertions, 3 deletions
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 |
