[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Pop Return results after pcall'ing
- From: Sam Roberts <sroberts@...>
- Date: Fri, 27 Oct 2006 09:02:22 -0700
On Fri, Oct 27, 2006 at 01:52:19PM +1300, Beric Holt wrote:
> Thanks Sam, that does make sense.
>
> Yeah I was talking about the second case: where my C code calls a lua
> function (it doesn't do a return back to lua).
> So I guess that the definitive answer is that I should pop the return
> values off the stack.
Sometimes its convenient to do the whole stack at once with
lua_settop(L,0) once you've done a chunk of work and know there is
nothing on the stack you want. Gives you a clean slate.
Sam