<table><tr><td style="">dfaure 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/D21121">View Revision</a></tr></table><br /><div><div><p>I don't really like shared_ptr for things like this. To me shared_ptr means "ownership is unclear" (when misused) or "ownership is shared between multiple objects, we need refcounting so that the last user deletes it".<br />
This isn't the case here. ItemRetriever creates the requests, ItemRetrievalManager processes them (but never owns them), and then we need to delete them after use.<br />
A refcount is unnecessary (i.e. overkill) and makes it harder to find out the ownership situation by reading the code.<br />
The owner is clear and unique: it's the <tt style="background: #ebebeb; font-size: 13px;">requests</tt> list. Hence the <tt style="background: #ebebeb; font-size: 13px;">delete</tt> after the <tt style="background: #ebebeb; font-size: 13px;">removeOne</tt>.</p></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21121">https://phabricator.kde.org/D21121</a></div></div><br /><div><strong>To: </strong>dfaure, dvratil<br /><strong>Cc: </strong>anthonyfieroni, kde-pim<br /></div>