Make sure all pattern args get cleared when parsing a new pattern

The user can call qSetMessagePattern after program start, so we need to
be sure that the parsed argument data is properly cleared.

Task-number: QTBUG-57144
Change-Id: I1978c6b95bd84639a8c4fffd1487429b04725522
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
Thiago Macieira 2016-11-15 07:37:16 -08:00
parent 50aeedd86c
commit 20526cb014

View File

@ -1039,6 +1039,10 @@ void QMessagePattern::setPattern(const QString &pattern)
delete [] literals;
}
delete [] tokens;
timeArgs.clear();
#ifdef QLOGGING_HAVE_BACKTRACE
backtraceArgs.clear();
#endif
// scanner
QList<QString> lexemes;