Commit 7265be97 authored by David Hallas's avatar David Hallas Committed by Kurt Hindenburg

Fix memory leak of HotSpot

Summary:
Fixes memory leaf of HotSpots. This is caused by the Filter::reset()
function failing to delete the allocated HotSpots before clearing the
list.

Test Plan:
Compile konsole with address sanitizer
Select a link in the terminal
Close konsole

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D19636
parent 4a7a31b3
......@@ -190,15 +190,16 @@ Filter::Filter() :
Filter::~Filter()
{
QListIterator<HotSpot *> iter(_hotspotList);
while (iter.hasNext()) {
delete iter.next();
}
reset();
}
void Filter::reset()
{
_hotspots.clear();
QListIterator<HotSpot *> iter(_hotspotList);
while (iter.hasNext()) {
delete iter.next();
}
_hotspotList.clear();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment