<table><tr><td style="">vkrause added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D26393">View Revision</a></tr></table><br /><div><div><p>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.</p>
<p>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.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R168 Kleopatra</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26393">https://phabricator.kde.org/D26393</a></div></div><br /><div><strong>To: </strong>adridg<br /><strong>Cc: </strong>vkrause, kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, mlaurent, knauss, dvratil<br /></div>