Details
Description
It seems that shiboken 6.8.x introduced changes in the SmartPointer handling. In the generated _wrapper.cpp files, there is a new section
// Convert to SmartPointer derived class: [QSharedPointer<QObject>] Shiboken::Conversions::addPythonToCppValueConversion(Shiboken::Conversions::getConverter("QSharedPointer<QObject>"), QSharedPointer_nexxT_Port__PythonToCpp_QSharedPointer_QObject_, is_QSharedPointer_nexxT_Port__PythonToCpp_QSharedPointer_QObject__Convertible); ///////////////////////////////////////////////////////////////////////////////////////
in the init_QSharedPointer_<type> functions (in the example posted here, type is nexxT_Port). For my project, this results in a segmentation fault as soon as I try to import the wrapper module. Ive tried out 3 things:
1. Comment out the new conversion code and recompile. The crash is gone in this case.
2. In the module_wrapper.cpp PyInit() function, fix the order of AddTypeCreationFunction from
// not working! Shiboken::Module::AddTypeCreationFunction(module, "QSharedPointer_nexxT_Port", init_QSharedPointer_nexxT_Port); Shiboken::Module::AddTypeCreationFunction(module, "QSharedPointer_QObject", init_QSharedPointer_QObject);
to
// working Shiboken::Module::AddTypeCreationFunction(module, "QSharedPointer_QObject", init_QSharedPointer_QObject); Shiboken::Module::AddTypeCreationFunction(module, "QSharedPointer_nexxT_Port", init_QSharedPointer_nexxT_Port);
This also results in the crash being fixed.
3. I also tried to create a minimal example, but I failed. I can attach the WIP to the issue if necessary.
Attachments
Issue Links
- resulted from
-
PYSIDE-1397 Shared pointer must be convertible to base class
- Closed