Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c9129b07 authored by David Faure's avatar David Faure

Fix crash due to using an attribute from a collection that went out of scope

Summary: Probably a consequence of the const/non-const changes (detaching?)

Test Plan:
Untested, but based on a crash report by Allen, pointing to
ETMCalendar::alarms() calling BlockAlarmsAttribute::isAlarmTypeBlocked
on line 579.

Reviewers: dvratil, winterz

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D20079
parent 95b1677f
......@@ -549,11 +549,12 @@ KCalCore::Alarm::List ETMCalendar::alarms(const QDateTime &from,
while (i.hasNext()) {
const Akonadi::Item item = i.next().value();
Akonadi::Collection parentCollection; // must have same lifetime as blockedAttr
BlockAlarmsAttribute *blockedAttr = nullptr;
if (excludeBlockedAlarms) {
// take the collection from m_collectionMap, because we need the up-to-date collection attrs
Akonadi::Collection parentCollection = d->mCollectionMap.value(item.storageCollectionId());
parentCollection = d->mCollectionMap.value(item.storageCollectionId());
if (parentCollection.isValid() && parentCollection.hasAttribute<BlockAlarmsAttribute>()) {
blockedAttr = parentCollection.attribute<BlockAlarmsAttribute>();
if (blockedAttr->isEverythingBlocked()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment