Commit 9372cf71 authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Fix SearchTask memleak

There's a `autoDelete` option for a task, but it's up to the
task to implement how it will delete itself. For SearchHistoryTask
this never happened.

I tested holding the `search` button for around one minute and the
memory was slowly growing and never freed. Adding a destructor with a
debug to remove any doubt made me realize: The search task was only
removed when konsole closed.

This is not just about the Memory Management, as the search was also
connected to multiple objects and could potentially mishandle searches.
parent e713c90c
......@@ -41,6 +41,10 @@ void SearchHistoryTask::execute()
iter.next();
executeOnScreenWindow(iter.key() , iter.value());
}
if (autoDelete()) {
deleteLater();
}
}
void SearchHistoryTask::executeOnScreenWindow(const QPointer<Session> &session , const ScreenWindowPtr& window)
......
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