@@ -818,6 +818,10 @@ subscribe e ws = do
818818 liftIO $ subscribeEventSubscribed subd ws
819819 return subd
820820
821+noinlineFalse :: Bool
822+noinlineFalse = False
823+{-# NOINLINE noinlineFalse #-}
824+
821825getRootSubscribed :: Root a -> EventM (RootSubscribed a)
822826getRootSubscribed r = do
823827 mSubscribed <- liftIO $ readIORef $ rootSubscribed r
@@ -829,6 +833,7 @@ getRootSubscribed r = do
829833 -- 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
830834 uninit <- rootInit r $ RootTrigger (subscribersRef, rootOccurrence r)
831835 addFinalizer subscribed $ do
836+ when noinlineFalse $ putStr "" -- For some reason, without this line, the finalizer will run earlier than it should
832837-- putStrLn "Uninit root"
833838 uninit
834839 liftIO $ writeIORef (rootSubscribed r) $ Just subscribed