On 21 Nov 2008, at 21:53, William Newbery wrote:
virtual Py::Object getattr(const char *name)
else return getattr_methods(name);
asObject takes ownership of cls2. And when the ref count drops to 0 cls2 is deleted.
You then pass a pointer to a deleted object ot asObject as get a crash.
I suggest that you keep cls2 is a Py::Object so that you keep a ref count of 1 so long as Cls() exists.
I added std::cout to the c'tor and d'tor of your objects to prove this was the case.