21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 88d2e9a1 authored by Artur Grunau's avatar Artur Grunau
Browse files

Fix a double free in LogHighlighter's destructor

In its destructor, LogHighlighter first of all deleted its filter regex
explicitly, and then called `setFilterRegExp(0)`, triggering a second —
this time somewhat implicit — delete. If the filter regex pointer was
not NULL, this caused the application to crash due to a double-free.

Fix this error by not invoking `setFilterRegExp` in LogHighlighter's
destructor; the explicit delete performs the same cleanup as
`setFilterRegExp` anyways.
parent e7b11bfa
...@@ -89,7 +89,6 @@ namespace campvis { ...@@ -89,7 +89,6 @@ namespace campvis {
LogHighlighter::~LogHighlighter() { LogHighlighter::~LogHighlighter() {
delete _filterRegExp; delete _filterRegExp;
delete _logLevelRegExp; delete _logLevelRegExp;
setFilterRegExp(0);
} }
void LogHighlighter::setFilterRegExp(const QRegExp* filterRegExp) { void LogHighlighter::setFilterRegExp(const QRegExp* filterRegExp) {
......
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