[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Q on functions as first class values
- From: Alex Sandro Queiroz e Silva <ventonegro@...>
- Date: Wed, 02 Feb 2005 17:01:37 -0300
Hallo,
Michael Newberry wrote:
Yes, I understand that lua_pushstring() has no effect here. Although
the second value was discarded, isn't sOldTitle just referencing the
memory location of the returned value of the function SetTitle() ?
That is what I was attempting to describe in the first message.
Everytime you call lua_pushstring() a new string is pushed onto the
stack. This new string has a different address than the previous ones
(unless garbage collection ocurred, but sOldTitle would have to be set
to nil to allow the collection of the previous string). So no, the
memory location pointed to by sOldTitle isn't overwritten with new strings.
Can we see g_LuaScript.SetTitle() code?
-alex
http://www.ventonegro.org/