Re: [luabind] Wrong userdata pointer returned since update to luabind 0.9
Brought to you by:
arvidn,
daniel_wallin
From: Daniel W. <da...@bo...> - 2010-02-24 15:23:29
|
On Wed, Feb 24, 2010 at 02:51:40PM +0100, Stefan Reusch wrote: > Here are the two functions... [...] > bool CLuaLabel::Create(luabind::object const& ParentWindow, > luabind::table<luabind::object> const& Rect) { > CRect r; > CLuaWnd<>* pParent = NULL; > > if(luabind::type(ParentWindow) == LUA_TUSERDATA) { > pParent = luabind::touserdata<CLuaWnd<>>(ParentWindow); This line doesn't extract the held C++ object. It should be something like: pParent = luabind::object_cast<CLuaWnd<>*>(ParentWindow); Assuming CLuaWnd is a registered base. > The code has worked before i switched to luabind 0.9, but perhaps you > has an idea what the problem is... Are you sure this worked before? I don't see how it could. -- Daniel Wallin BoostPro Computing http://www.boostpro.com |