Fixes memory leak in KItemListViewAccessible
ClosedPublic

Authored by hallas on Jul 16 2018, 8:38 PM.

Details

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.

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
hallas created this revision.Jul 16 2018, 8:38 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptJul 16 2018, 8:38 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
hallas requested review of this revision.Jul 16 2018, 8:38 PM
jtamate accepted this revision.Jul 17 2018, 6:41 AM

It fixes the memory leak.

This revision is now accepted and ready to land.Jul 17 2018, 6:41 AM
elvisangelaccio accepted this revision.Jul 17 2018, 8:53 PM
elvisangelaccio added a subscriber: elvisangelaccio.

@hallas Thanks. Do you have commit access?

@hallas Thanks. Do you have commit access?

Nope ;)

This revision was automatically updated to reflect the committed changes.