mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
fix LogDialog deadlock by removing unneeded mutex, closes #1624
This commit is contained in:
parent
120001ecac
commit
fb0f28cd7c
2 changed files with 1 additions and 6 deletions
|
@ -97,7 +97,7 @@ void LogDialog::initControls() {
|
|||
}
|
||||
|
||||
void LogDialog::showEvent(QShowEvent*) {
|
||||
connect(_logger, SIGNAL(logReceived(QString)), this, SLOT(appendLogLine(QString)));
|
||||
connect(_logger, SIGNAL(logReceived(QString)), this, SLOT(appendLogLine(QString)), Qt::QueuedConnection);
|
||||
showLogData();
|
||||
}
|
||||
|
||||
|
@ -111,11 +111,9 @@ void LogDialog::resizeEvent(QResizeEvent*) {
|
|||
|
||||
void LogDialog::appendLogLine(QString logLine) {
|
||||
if (isVisible()) {
|
||||
_mutex.lock();
|
||||
if (logLine.contains(_searchTerm, Qt::CaseInsensitive)) {
|
||||
_logTextBox->appendPlainText(logLine.simplified());
|
||||
}
|
||||
_mutex.unlock();
|
||||
_logTextBox->ensureCursorVisible();
|
||||
}
|
||||
}
|
||||
|
@ -140,12 +138,10 @@ void LogDialog::handleSearchTextChanged(const QString searchText) {
|
|||
|
||||
void LogDialog::showLogData() {
|
||||
_logTextBox->clear();
|
||||
_mutex.lock();
|
||||
QStringList _logData = _logger->getLogData();
|
||||
for (int i = 0; i < _logData.size(); ++i) {
|
||||
appendLogLine(_logData[i]);
|
||||
}
|
||||
_mutex.unlock();
|
||||
}
|
||||
|
||||
KeywordHighlighter::KeywordHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent), keywordFormat() {
|
||||
|
|
|
@ -60,7 +60,6 @@ private:
|
|||
QCheckBox* _extraDebuggingBox;
|
||||
QPushButton* _revealLogButton;
|
||||
QPlainTextEdit* _logTextBox;
|
||||
QMutex _mutex;
|
||||
QString _searchTerm;
|
||||
KeywordHighlighter* _highlighter;
|
||||
|
||||
|
|
Loading…
Reference in a new issue