@@ -336,7 +336,7 @@ function :: MakeStringRef name
336 -- call the Haskell one when it is called
336 -- call the Haskell one when it is called
337#if defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)
337#if defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)
338function name f = liftIO $ do
338function name f = liftIO $ do
339− callback <- syncCallback2 NeverRetain True $ \this args -> do
339+ callback <- syncCallback2 AlwaysRetain True $ \this args -> do
340 rargs <- fromArray args
340 rargs <- fromArray args
341 runReaderT (f this this rargs) () -- TODO pass function object through
341 runReaderT (f this this rargs) () -- TODO pass function object through
342 makeFunctionWithCallback (makeStringRef name) callback
342 makeFunctionWithCallback (makeStringRef name) callback