problem on using shared_ptr

[email protected]
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
i have a class which uses shared_ptr:

class Entity:public boost::enable_shared_from_this<Entity>
{
public:
  typedef boost::shared_ptr<Entity> Ptr;
...
...
}

and i registed it like this:

 module(context,"sys")
  [
  class_<Entity,Entity::Ptr>("Entity")
 ...
 ...
  ];


and also i have a little script as:

function ProcessUpdate(sender)
  prient("update!");
end


now i pass a Entity::Ptr as a parameter to a lua function:

void Server::LuaLogic::ProcessUpdate( Entity::Ptr sender )
{
  _mutContext.lock();
  lua_State *l = _l->Lock();
  int idx=lua_gettop(l);

  try
  {
    luabind::object pu = luabind::globals(l)["ProcessUpdate"];

    if(luabind::type(pu)==LUA_TFUNCTION)
    {
     pu(sender);
    }
  }
 catch (luabind::error* e)
 {
    const char* what = e->what();
 }

lua_settop(l,idx);

 _l->Unlock();
 _mutContext.unlock();
}


and after(or during) the "pu(sender);",my debuger noticed me a
luabind::error,in object.hpp at line 1156,and i can`t catch it at all so i
don`t understand what happend.

any help please?

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.