Re: [C++-sig] How to hangle a NULL pointer?

2012-10-02 Thread Jeffrey Van Voorst
You might want to use wrapper functions in C++ boost::python::object gender_getter(const FaceObject& obj) { if(obj.gender == NULL) return Py_None; else return obj.gender; } Note: its been a bit since I used Boost.Python heavily. The syntax could be incorrect, but I hope this gives you a ge

[C++-sig] Boost.Python C++ exception translation question

2012-10-30 Thread Jeffrey Van Voorst
Greetings, I have used a method mentioned on stackoverflow (http://stackoverflow.com/questions/6908976/generalized-exception-translation-for-boost-python) for a generalized method to translate C++ exceptions to python exceptions. When debugging my code using gdb the frames seem to indicate th

Re: [C++-sig] Segfaults in object deallocation

2013-03-20 Thread Jeffrey Van Voorst
This could be misinformation, but some of the boost libraries have compile time flags that depend on whether or not threading is enabled. As an example, I was running into issues with an invalid free() with respect to shared_ptr (in the cctbx project). Unfortunately, (for your case) the fix wa