On 02/05/2012 07:49 PM, Adam Preble wrote:
Would using register_ptr_to_python explicitly and consistently instead of the online shared_ptr declaration potentially eliminate some side-effects? I cannot yet isolate why my real app crashes in python when it tries to do an eval into one of my wrappers.
Overall, I doubt it. Usually putting shared_ptr in the class_ template params would allow you to do more fancy shared_ptr tricks, not less. And as I said before, it might be necessary if you use enable_shared_from_this.
What your previous example showed, though, was that it might be useful to use register_ptr_to_python on every type you ever make a shared_ptr to in C++ *in addition* to putting shared_ptr in the class_ templates - you'll get some warnings in Python about redundant converters, and those will tell you which of those extra declarations it's safe to remove. Any that remain might help fix your problem.
Jim _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig