on master help sign in
Use updated syncCallback2
32f8972Hamish Mackenzie
src/Language/Javascript/JSaddle/Object.hs+2−2
@@ -81,7 +81,7 @@ import Language.Javascript.JSaddle.Types
81import Foreign.C.Types (CSize(..), CULong(..), CUInt(..))
81import Foreign.C.Types (CSize(..), CULong(..), CUInt(..))
82#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
82#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
83import GHCJS.Types (nullRef, castRef, JSArray, JSFun)
83import GHCJS.Types (nullRef, castRef, JSArray, JSFun)
84−import GHCJS.Foreign (newObj, toArray, fromArray, syncCallback2)
84+import GHCJS.Foreign (newObj, toArray, fromArray, syncCallback2, ForeignRetention(..))
85import Control.Monad (liftM)
85import Control.Monad (liftM)
86import Control.Applicative ((<$>))
86import Control.Applicative ((<$>))
87#else
87#else
@@ -333,7 +333,7 @@ function :: MakeStringRef name
333 -- call the Haskell one when it is called
333 -- call the Haskell one when it is called
334#if defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)
334#if defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)
335function name f = liftIO $ do
335function name f = liftIO $ do
336− callback <- syncCallback2 False True $ \this args -> do
336+ callback <- syncCallback2 NeverRetain True $ \this args -> do
337 rargs <- fromArray args
337 rargs <- fromArray args
338 runReaderT (f this this rargs) () -- TODO pass function object through
338 runReaderT (f this this rargs) () -- TODO pass function object through
339 makeFunctionWithCallback (makeStringRef name) callback
339 makeFunctionWithCallback (makeStringRef name) callback