From a42989e696eac94221ddb781a133afaec5b48b12 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 28 Sep 2010 09:43:35 +0200 Subject: QmlViewer: Fix assert on exit (Windows) The QApplication object in main() is already destroyed when showWarnings() is called. Create another instance in this case. (Note that the assert will only be triggered for debug builds, while qmlviewer is built in release mode by default). Task-number: QTBUG-14009 Reviewed-by: Thomas Hartmann --- tools/qml/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 78cd64d..bf183e5 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -89,6 +89,9 @@ QString warnings; void showWarnings() { if (!warnings.isEmpty()) { + int argc = 0; char **argv = 0; + QApplication application(argc, argv); // QApplication() in main has been destroyed already. + Q_UNUSED(application) QMessageBox::warning(0, QApplication::tr("Qt QML Viewer"), warnings); } } -- cgit v0.12