D21121: Fix leaking of requests in ItemRetriever::exec()

Anthony Fieroni noreply at phabricator.kde.org
Sat May 11 13:36:20 BST 2019


anthonyfieroni added inline comments.

INLINE COMMENTS

> itemretriever.cpp:284
>                  itemRequests.insert(pimItemId, lastRequest);
> -                requests << lastRequest;
> +                requests.push_back(std::unique_ptr<ItemRetrievalRequest>(lastRequest));
>              } else {

`emplace_back(lastRequest)`

> itemretriever.cpp:332-335
> +        const auto it = std::find_if(requests.begin(), requests.end(), [finishedRequest](const auto &ptr) {
> +            return ptr.get() == finishedRequest;
> +        });
> +        if (it != requests.end()) {

`for (auto it = requests.begin(); it != requests.end(); ++it)`
Will be better.

REPOSITORY
  R165 Akonadi

REVISION DETAIL
  https://phabricator.kde.org/D21121

To: dfaure, dvratil
Cc: anthonyfieroni, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190511/85ed693f/attachment.html>


More information about the kde-pim mailing list