
27 Aug
2009
27 Aug
'09
2:04 a.m.
Hello. I would like to know what's wrong with this: Object * create() { return new Object(); } void addToScene(const std::string & name, Object * o) { //Store object in a std::multimap<std::string, Object *> } BOOST_PYTHON_MODULE(mod) { def("createObject", &create, return_value_policy<reference_existing_object>()); .... } I start my application, it works ok and it uses addToScene and create: Now I try to add a new object to my application from python:
obj = Object() addToScene("obj", obj)
Should the problem have anything to do with object lifetime? Or the segmentation fault is because of another issue? Thanks in advance.