mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
forgot releasing a stable pointer
This commit is contained in:
@@ -287,6 +287,7 @@ readExpr str =
|
|||||||
if c_expr == castPtrToStablePtr nullPtr
|
if c_expr == castPtrToStablePtr nullPtr
|
||||||
then return Nothing
|
then return Nothing
|
||||||
else do expr <- deRefStablePtr c_expr
|
else do expr <- deRefStablePtr c_expr
|
||||||
|
freeStablePtr c_expr
|
||||||
return (Just expr)
|
return (Just expr)
|
||||||
|
|
||||||
-- | parses a 'String' as a type
|
-- | parses a 'String' as a type
|
||||||
@@ -295,11 +296,12 @@ readType str =
|
|||||||
unsafePerformIO $
|
unsafePerformIO $
|
||||||
withText str $ \c_str ->
|
withText str $ \c_str ->
|
||||||
bracket mkUnmarshaller freeUnmarshaller $ \u -> do
|
bracket mkUnmarshaller freeUnmarshaller $ \u -> do
|
||||||
c_type <- pgf_read_type c_str u
|
c_ty <- pgf_read_type c_str u
|
||||||
if c_type == castPtrToStablePtr nullPtr
|
if c_ty == castPtrToStablePtr nullPtr
|
||||||
then return Nothing
|
then return Nothing
|
||||||
else do tp <- deRefStablePtr c_type
|
else do ty <- deRefStablePtr c_ty
|
||||||
return (Just tp)
|
freeStablePtr c_ty
|
||||||
|
return (Just ty)
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
-- Exceptions
|
-- Exceptions
|
||||||
|
|||||||
Reference in New Issue
Block a user