summaryrefslogtreecommitdiffstats
path: root/tools/qml
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qml')
-rw-r--r--tools/qml/qmlruntime.cpp12
-rw-r--r--tools/qml/qmlruntime.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 109de7d..e0482cf 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -623,6 +623,8 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
autoStopTimer.setRunning(false);
recordTimer.setRunning(false);
recordTimer.setRepeating(true);
+
+ QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(appAboutToQuit()));
}
QDeclarativeViewer::~QDeclarativeViewer()
@@ -1277,6 +1279,16 @@ void QDeclarativeViewer::ffmpegFinished(int code)
qDebug() << "ffmpeg returned" << code << frame_stream->readAllStandardError();
}
+void QDeclarativeViewer::appAboutToQuit()
+{
+ // avoid QGLContext errors about invalid contexts on exit
+ canvas->setViewport(0);
+
+ // avoid crashes if messages are received after app has closed
+ delete loggerWindow;
+ loggerWindow = 0;
+}
+
void QDeclarativeViewer::autoStartRecording()
{
setRecording(true);
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index cec3204..92c2969 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -131,6 +131,8 @@ protected:
void createMenu();
private slots:
+ void appAboutToQuit();
+
void autoStartRecording();
void autoStopRecording();
void recordFrame();