[C++-sig] copy boost::python::object crashes

2010-01-23 Thread sergun
I have a problem with storing reference to Python object inside C++. The following Boost.Python wrapping class: #include using namespace boost; using namespace boost::python; namespace cmodule { object y; void setY(object y1) { y = y1; } } using namespace cmodule; BOOST_PYTHON_MODULE(cm

Re: [C++-sig] copy boost::python::object crashes

2010-01-24 Thread sergun
Hi Jim, In my opinion “object y;” is just declaration of global object, not static variable of some class (in this case you are right: explicit declaration needed, something like: “object MyStaticClass::y;”). I have changed setY function to: void setY(PyObject * y1) { y = object(handle<>(y1));