D14168: Fixes memory leak in KItemListViewAccessible

David Hallas noreply at phabricator.kde.org
Mon Jul 16 21:38:59 BST 2018


hallas created this revision.
hallas added a reviewer: Dolphin.
Restricted Application added a project: Dolphin.
Restricted Application added a subscriber: kfm-devel.
hallas requested review of this revision.

REVISION SUMMARY
  The KItemListViewAccessible class has a list of QAccessibleInterface pointers in a member variable m_cells. The problem is that when new entries are created, the newly allocated pointer is not stored in the list, only a nullptr is store, this renders the cleanup code in the destructor useless. This patch simply stores the pointer in the list, causing the destructor to correctly free the memory.

TEST PLAN
  I found this issue using address sanitizer. Simply building Dolphin with -fsanitize=address and opening a window caused the memory leak.

REPOSITORY
  R318 Dolphin

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

AFFECTED FILES
  src/kitemviews/kitemlistviewaccessible.cpp

To: hallas, #dolphin
Cc: kfm-devel, spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180716/b52c66c2/attachment.htm>


More information about the kfm-devel mailing list