On Jan 7, 2008 5:27 AM, Klaas Holwerda <[EMAIL PROTECTED]> wrote:

>
> Euuh, no it crashes exactly as the stack above shows, luaO_rawequalObj, put i
> think the damage is already done at/before that moment.
> For some reason i think what is done in wxluaT_pushuserdatatype is ruining 
> the rest.
>

I think I see the problem, I don't pop an extra value we pushed.

bool LUACALL wxluaO_istrackedweakobject(lua_State *L, void *obj_ptr,
int wxl_type, bool push_on_stack)
...
    if (lua_istable(L, -1))
    {
        lua_pushnumber(L, wxl_type); // push key
        lua_rawget(L, -2);           // get t[key] = value; pops key

        // check if they've dynamic casted the object or if it was casted in C++
        if (wxlua_iswxuserdata(L, -1) && (wxl_type == wxluaT_type(L, -1)))
        {
            if (push_on_stack)
            {
                lua_remove(L, -3); // remove the obj table, leave
value on the stack
                lua_remove(L, -2); // remove table of userdata, leave
value on the stack
            }
            else
                lua_pop(L, 3);

            return true;
        }
        else
            lua_pop(L, 1); // pop the userdata that is not the right type
    }


------------------------
Add these two lines of code.

        else
            lua_pop(L, 1); // pop the userdata that is not the right type

-------------------------

I can't commit it right now since making static member variables work
is not finished yet.

Thanks,
    John

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to