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 BangPatterns #-}
|
||||
module Affection
|
||||
( withAffection
|
||||
, getAffection
|
||||
|
@ -108,10 +109,11 @@ withAffection AffectionConfig{..} = do
|
|||
-- clean the renderer form last time
|
||||
SDL.clear renderer
|
||||
-- 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
|
||||
{ drawStack = []
|
||||
, elapsedTime = elapsedTime ad + dt
|
||||
, elapsedTime = ne
|
||||
}
|
||||
-- poll events
|
||||
evs <- preHandleEvents =<< liftIO SDL.pollEvents
|
||||
|
|
Loading…
Reference in a new issue