D14666: Fixes memory leak in KUrlComboBox::setUrl

David Faure noreply at phabricator.kde.org
Tue Aug 7 10:15:32 BST 2018


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kurlcombobox.cpp:279
>          Q_ASSERT(!d->itemList.isEmpty());
> +        delete d->itemList.last();
>          d->itemList.removeLast();

This could be merged with the next line, by doing

  delete d->itemList.takeLast();

> kurlcombobox.cpp:363
>          if (url.toString(QUrl::StripTrailingSlash) == mit.value()->url.toString(QUrl::StripTrailingSlash)) {
>              if (!d->itemList.removeAll(mit.value()) && checkDefaultURLs) {
>                  d->defaultList.removeAll(mit.value());

Doesn't this have the same issue? delete missing

> kurlcombobox.cpp:364
>              if (!d->itemList.removeAll(mit.value()) && checkDefaultURLs) {
>                  d->defaultList.removeAll(mit.value());
>              }

same here, right?

REPOSITORY
  R241 KIO

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

To: hallas, dfaure
Cc: dfaure, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180807/b6d11ee4/attachment.html>


More information about the Kde-frameworks-devel mailing list