fixed little memory leak concerning float values
This commit is contained in:
parent
3ac1049ec7
commit
ea8fdf37ee
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
|
{-# LANGUAGE BangPatterns #-}
|
||||||
module Affection
|
module Affection
|
||||||
( withAffection
|
( withAffection
|
||||||
, getAffection
|
, getAffection
|
||||||
|
@ -108,10 +109,11 @@ withAffection AffectionConfig{..} = do
|
||||||
-- clean the renderer form last time
|
-- clean the renderer form last time
|
||||||
SDL.clear renderer
|
SDL.clear renderer
|
||||||
-- compute dt and update elapsedTime
|
-- compute dt and update elapsedTime
|
||||||
let dt = (fromIntegral $ toNanoSecs $ diffTimeSpec lastTime now) / (fromIntegral 10 ^ 9)
|
let !dt = (fromIntegral $ toNanoSecs $ diffTimeSpec lastTime now) / (fromIntegral 10 ^ 9)
|
||||||
|
!ne = elapsedTime ad + dt
|
||||||
put $ ad
|
put $ ad
|
||||||
{ drawStack = []
|
{ drawStack = []
|
||||||
, elapsedTime = elapsedTime ad + dt
|
, elapsedTime = ne
|
||||||
}
|
}
|
||||||
-- poll events
|
-- poll events
|
||||||
evs <- preHandleEvents =<< liftIO SDL.pollEvents
|
evs <- preHandleEvents =<< liftIO SDL.pollEvents
|
||||||
|
|
Loading…
Reference in a new issue