fixed creating messagebox on wrong thread

This commit is contained in:
fourtf
2018-06-21 22:44:48 +02:00
parent 713d0c9599
commit 00d538b368
2 changed files with 56 additions and 50 deletions
+9 -6
View File
@@ -2,6 +2,7 @@
#include "util/combine_path.hpp"
#include "util/networkrequest.hpp"
#include "util/posttothread.hpp"
#include "version.hpp"
#include <QMessageBox>
@@ -95,12 +96,14 @@ void UpdateManager::checkForUpdates()
this->setStatus_(SearchFailed);
qDebug() << "error updating";
QMessageBox *box =
new QMessageBox(QMessageBox::Information, "Chatterino Update",
"Error while searching for updates.\n\nEither the service is down "
"temporarily or everything is broken.");
box->setAttribute(Qt::WA_DeleteOnClose);
box->show();
util::postToThread([] {
QMessageBox *box = new QMessageBox(
QMessageBox::Information, "Chatterino Update",
"Error while searching for updates.\n\nEither the service is down "
"temporarily or everything is broken.");
box->setAttribute(Qt::WA_DeleteOnClose);
box->show();
});
return;
}