From 39eee858e6fef1f94293a382c170155cf297ae31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sun, 27 May 2018 21:57:37 +0200 Subject: [PATCH] Fix Memory Bug in AsyncTaskDialog --- src/dialogs/AsyncTaskDialog.cpp | 6 +++--- src/dialogs/AsyncTaskDialog.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dialogs/AsyncTaskDialog.cpp b/src/dialogs/AsyncTaskDialog.cpp index 87ce3c49..3742e5bc 100644 --- a/src/dialogs/AsyncTaskDialog.cpp +++ b/src/dialogs/AsyncTaskDialog.cpp @@ -23,7 +23,7 @@ AsyncTaskDialog::AsyncTaskDialog(AsyncTask *task, QWidget *parent) close(); }); - updateLog(); + updateLog(task->getLog()); connect(&timer, SIGNAL(timeout()), this, SLOT(updateProgressTimer())); timer.setInterval(1000); @@ -37,9 +37,9 @@ AsyncTaskDialog::~AsyncTaskDialog() { } -void AsyncTaskDialog::updateLog() +void AsyncTaskDialog::updateLog(const QString &log) { - ui->logTextEdit->setPlainText(task->getLog()); + ui->logTextEdit->setPlainText(log); } void AsyncTaskDialog::updateProgressTimer() diff --git a/src/dialogs/AsyncTaskDialog.h b/src/dialogs/AsyncTaskDialog.h index b5cf3c5a..ed8c08dc 100644 --- a/src/dialogs/AsyncTaskDialog.h +++ b/src/dialogs/AsyncTaskDialog.h @@ -25,7 +25,7 @@ public slots: void reject() override; private slots: - void updateLog(); + void updateLog(const QString &log); void updateProgressTimer(); protected: