Question regarding wrap_base and objects created in C++

View: New views
1 Messages — Rating Filter:   Alert me  

Question regarding wrap_base and objects created in C++

by Thomas Nelson-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm running into a problem with objects derived from wrap_base and I think I
may just be missing something obvious.

I have a case where I am exporting a c++ class derived from
luabind::wrap_base into lua. I then create the object in the c++ and try and
assign it to a global variable visible to lua.

Something like the following:

M_pZoneProxy = new ZoneManagerProxy();
luabind::globals(pScript)["_World"] = m_pZoneProxy;

The code crashes/asserts in the assignment because the wrap_base contains an
uninitialized weak_ref (the private m_impl member of weak_ref is null).

How do I initialize this value?

--
Thomas Nelson  tdark@...  
--------------------------------------------------------------
"If you still have gas, you're not lost".
- French explorer Pierre Frontage.
(M.Frontage was so influential in the exploration of North America many
roads are still named after him.)




------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
luabind-user mailing list
luabind-user@...
https://lists.sourceforge.net/lists/listinfo/luabind-user