[Kde-pim] Missing virtual destructor, and question about embedded message composition

Ingo Klöcker kloecker at kde.org
Thu Jan 12 21:44:42 GMT 2012


On Wednesday 11 January 2012, Shaheed Haque wrote:
> Hi all,
> 
> I'm having a little trouble in trying to add support for embedded
> message/rfc822 attachments in the playground Exchange resource.
> Basically, I
> 
> - start with a top level KMime::message
> 
> - create a second level KMime:Message
> 
> - secondLevel.assemble()
> 
> - topLevel.addContent(secondLevel)
> 
> - topLevel.assemble()
> 
> However, shortly afterwards, as Akonadi::ItemModifyJob is being
> destroyed, the code craps out as per the stack trace below. Two
> points arise:
> 
> 1. In looking at the code in GIT, I notice that
> KMime::Message::~Message is not virtual, whereas KMime::~Content
> from which it derives is virtual.

If ~Content() is virtual and Message is derived from Content then 
~Message() is automatically also virtual (even if the explicit 'virtual' 
is missing). The same is true for any other method re-implementing a 
virtual method of a base class.


> Should that be fixed (or is there some BC implication?)

Yes, but only because it makes it more obvious to the reader of the 
source code that ~Message() is virtual. Technically, this won't change 
anything.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20120112/8c9605b3/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list