Changeset 7552 for src/Pugs/Embed

Show
Ignore:
Timestamp:
10/11/05 00:56:12 (3 years ago)
Author:
autrijus
Message:

* finalize Parrot embedding properly and let it flush

correctly, by calling Parrot_exit at exit. leo++

Location:
src/Pugs/Embed
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Embed/Parrot.hsc

    r7518 r7552  
    134134import System.IO.Unsafe 
    135135import System.Directory 
     136import Pugs.Internals (_GlobalFinalizer) 
    136137 
    137138type ParrotString               = Ptr () 
     
    163164    parrot_set_run_core interp PARROT_CGP_CORE 
    164165#endif 
     166    -- parrot_set_debug interp 0x20 
    165167    parrot_imcc_init interp 
    166168    callback    <- mkCompileCallback compileToParrot 
     
    174176    set_pf_cur_cs pf seg 
    175177    parrot_loadbc interp pf 
     178    modifyIORef _GlobalFinalizer (>> parrot_exit 0) 
    176179    return interp 
    177180 
     
    283286    parrot_get_strreg :: ParrotInterp -> CInt -> IO ParrotString 
    284287 
     288foreign import ccall "Parrot_set_debug" 
     289    parrot_set_debug :: ParrotInterp -> CInt -> IO () 
     290 
     291foreign import ccall "Parrot_exit" 
     292    parrot_exit :: CInt -> IO () 
     293 
    285294foreign import ccall "string_to_cstring" 
    286295    parrot_string_to_cstring :: ParrotInterp -> ParrotString -> IO CString 
  • src/Pugs/Embed/Perl5.hs

    r7413 r7552  
    135135                Just val -> pugs_setenv =<< mkVal val 
    136136                Nothing -> return () 
     137            modifyIORef _GlobalFinalizer (>> perl_free interp) 
    137138            return interp 
    138139