[Kde-pim] resource crashes using deleted attribute

Daniel Vrátil dvratil at kde.org
Sun Apr 12 11:00:08 BST 2015


On Sunday, April 12, 2015 10:18:04 AM David Faure wrote:
> On Sunday 12 April 2015 01:27:42 David Faure wrote:
> >             EntityAnnotationsAttribute *annotationsAttribute =
> >             
> >                     mCollection.attribute<EntityAnnotationsAttribute>(
> > 
> > Akonadi::Collection::AddIfMissing );
> > 
> > mCollection.addAttribute(annotationsAttribute);
> 
> Ah! The crash only happens when the attribute was already there.
> AddIfMissing takes care of adding the attribute, so I shouldn't call
> addAttribute again, right?

Right! I did not notice that

> 
> I guess Collection could warn+return if the attribute is already in the
> list?

No need for warning I guess, just return.

Dan


-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20150412/835d4378/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