[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: suggestion on error returns, especially in callbacks from C?
- From: roberto@... (Roberto Ierusalimschy)
- Date: Tue, 5 Dec 2006 16:28:15 -0200
> > In the case of expat, there is a good chance expat does not deal
> > well with being longjmped out of (though perhaps it does), and will
> > leak resources as the error propogates up back to lua code.
>
> It does (or at least it did, when I first wrote the lexpat library). It
> was "documented" somewhere (in an answer to a question in its mailing
> list, if I remeber correctly).
I am sorry for the bad information. Actually, I found "documented"
somewhere that it was *not* safe to longjmp Expat, so the real library
(luaexpat) uses lua_pcall to call Lua handles. The code in the book was
(maybe over) simplified. (The real code is a little tricky, because once
there is an error it must stop calling other handles, but there is
no way to stop Expat.)
-- Roberto