Hi miguel

The problem is really curious.
The function variant_cast use by createInstance not work properly and do a infinit recursive call on itself.

    template<typename T> T variant_cast(const Value& v)
    {
        // return value
        Value::Instance<T> *i = dynamic_cast<Value::Instance<T> *>(v._inbox->inst_);
        if (i) return i->_data;

        // return reference to value
        i = dynamic_cast<Value::Instance<T> *>(v._inbox->_ref_inst);
        if (i) return i->_data;

        // return const reference to value
        i = dynamic_cast<Value::Instance<T> *>(v._inbox->_const_ref_inst);
        if (i) return i->_data;

        // try to convert v to type T and restart
        return variant_cast<T>(v.convertTo(typeof(T)));
    }

As you can see, this function try to dynamic_cast the value 3 time (one for the value, second for the reference value and third for the const reference value), if any cast work fine, the type is convert in the desired type and the variant_cast is done again, and normally one of the three dynamic_cast must work.
In own case, three first dynamic_cast fail and a convertTo is done, but three dynamic_cast fail again and a convertTo is call again, and so on.

Normally (In own case) the first dynamic_cast must work and return the casted value.



You can add some code in variant_cast function to check the rtti info. The dynamic_cast fail and you must do the same work of it to see where is the problem.

For example :

Compare the std::type_info and std::type_info.name() between "i" and "v._inbox->inst_"
...



If you don't find the problem, try to load your test.so from a test_binary to check if the problem didn't come from python.
...


else .. i don' t know ... for this time :-).  We always fine what is the problem if we take the time to search.


Give me news on this problem if you found and if you didn't found too.
Good luck

David


PS: I didn't do this two test because i must work on my project and with my little computer, i past 2 hours to build osgIntrospection and wrapper.

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to