fixed bug caused by comparing temporary object output of uniqueIdentifier() method to another string

This commit is contained in:
csoler 2019-12-15 18:40:42 +01:00
parent 11c520d280
commit 459ddc8883
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -491,7 +491,14 @@ FeedItem *RSFeedWidget::findFeedItem(const std::string& identifier)
continue;
}
if (feedItem->uniqueIdentifier() == identifier)
// (cyril) It seems that a local variable must be used to store this identifier.
// Directly comparing identifier such as in:
// if(feedItem->uniqueIdentifier() == identifier)
// causes a crash. I dont know why! If someone ever finds why, please tell me.
std::string id = feedItem->uniqueIdentifier();
if (id == identifier)
return feedItem;
}