on develop help sign in
Merge branch 'master' into develop
09f6f39Ali Abrar
reflex.cabal+1−1
@@ -1,5 +1,5 @@
1Name: reflex
1Name: reflex
2−Version: 0.1.0
2+Version: 0.1.1
3Synopsis: Higher-order Functional Reactive Programming
3Synopsis: Higher-order Functional Reactive Programming
4Description: Reflex is a high-performance, deterministic, higher-order Functional Reactive Programming system
4Description: Reflex is a high-performance, deterministic, higher-order Functional Reactive Programming system
5License: BSD3
5License: BSD3
src/Reflex/Spider/Internal.hs+5
@@ -818,6 +818,10 @@ subscribe e ws = do
818 liftIO $ subscribeEventSubscribed subd ws
818 liftIO $ subscribeEventSubscribed subd ws
819 return subd
819 return subd
820
820
821+noinlineFalse :: Bool
822+noinlineFalse = False
823+{-# NOINLINE noinlineFalse #-}
824+
821getRootSubscribed :: Root a -> EventM (RootSubscribed a)
825getRootSubscribed :: Root a -> EventM (RootSubscribed a)
822getRootSubscribed r = do
826getRootSubscribed r = do
823 mSubscribed <- liftIO $ readIORef $ rootSubscribed r
827 mSubscribed <- liftIO $ readIORef $ rootSubscribed r
@@ -829,6 +833,7 @@ getRootSubscribed r = do
829 -- Strangely, init needs the same stuff as a RootSubscribed has, but it must not be the same as the one that everyone's subscribing to, or it'll leak memory
833 -- Strangely, init needs the same stuff as a RootSubscribed has, but it must not be the same as the one that everyone's subscribing to, or it'll leak memory
830 uninit <- rootInit r $ RootTrigger (subscribersRef, rootOccurrence r)
834 uninit <- rootInit r $ RootTrigger (subscribersRef, rootOccurrence r)
831 addFinalizer subscribed $ do
835 addFinalizer subscribed $ do
836+ when noinlineFalse $ putStr "" -- For some reason, without this line, the finalizer will run earlier than it should
832-- putStrLn "Uninit root"
837-- putStrLn "Uninit root"
833 uninit
838 uninit
834 liftIO $ writeIORef (rootSubscribed r) $ Just subscribed
839 liftIO $ writeIORef (rootSubscribed r) $ Just subscribed