fixed little memory leak concerning float values

This commit is contained in:
nek0 2017-02-24 00:18:29 +01:00
parent 3ac1049ec7
commit ea8fdf37ee

View file

@ -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