D26393: Expand dynamic cast hierarchy.
Volker Krause
noreply at phabricator.kde.org
Sat Jan 4 10:19:57 GMT 2020
vkrause added a comment.
I have a theory where this might come from, but I can't verify this here (problem is not reproduceable): KeyListModelInterface is in a different lib and is not exported (all inline), but has a vtable and RTTI data. This results in the RTTI data being duplicated in every lib/executable (as there is no exported one that can be shared), which means there's two different RTTI instances for the kleo binary and libkleo, dynamic_cast picks the wrong one in your setup, and fails. The second level cast to KeyRearrangeColumnsProxyModel (in libkleo, but exported) makes it cast from a type in the same lib, which then apparently makes it pick the right RTTI instance and succeed.
If this is right, I'd say the correct fix is exporting KeyListModelInterface, and de-inlining its virtual dtor, I'm not sure that the double cast fix is guaranteed to always work.
REPOSITORY
R168 Kleopatra
REVISION DETAIL
https://phabricator.kde.org/D26393
To: adridg
Cc: vkrause, kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200104/5cd76410/attachment.html>
More information about the kde-pim
mailing list