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 From cf4c64a8f155c179f51d2cddd81bae4701826871 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 28 Sep 2010 09:54:11 +0200 Subject: QmlViewer: Fix typo in comment --- tools/qml/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index bf183e5..00d43c1 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -519,7 +519,7 @@ int main(int argc, char ** argv) #if defined (Q_OS_WIN) // Debugging output is not visible by default on Windows - - // therefore show modal dialog with errors instad. + // therefore show modal dialog with errors instead. atexit(showWarnings); #endif -- cgit v0.12