Re: Userdata and methods
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Userdata and methods
- From: Edgar Toernig <froese@...>
- Date: 2001年11月20日 05:28:43 +0100
Philip Bock wrote:
>
> if ((lua_gettop(client_state) >= 5) && lua_isuserdata(client_state, 1))
> {
> Viewport *this_viewport = (Viewport *) lua_touserdata(client_state, 1);
>
> The program gives a segmentation fault at the first attempt to access
> this_viewport after it is initialized. Anyone have any ideas? I'm new to
> Lua, so it's probably just a stupid mistake. Thanks, Philip Bock.
Hmm... looks sane. Are you sure, your lua_pushusertag is correct? Or that
you get the right userdata object (you don't check the tag)?
Ciao, ET.