Stopped MTRelease being called with a NULL pointer

This commit is contained in:
Neil Brown 2009-03-19 16:59:19 +00:00
parent 65875f523f
commit 7d3e9e8648

View File

@ -1299,7 +1299,13 @@ cdeclareInit _ _ _ = Nothing
-- | Free a declared item that's going out of scope.
cdeclareFree :: Meta -> A.Type -> A.Variable -> Maybe (CGen ())
cdeclareFree _ _ _ = Nothing -- TODO free mobiles that are going out of scope
cdeclareFree _ (A.Mobile {}) v = Just $
do tell ["if ("]
call genVariable v
tell ["!=NULL){MTRelease(wptr,(void*)"]
call genVariable v
tell [");}"]
cdeclareFree _ _ _ = Nothing
{-
Original Abbrev