diff options
Diffstat (limited to 'tools/qml/qmlruntime.cpp')
-rw-r--r-- | tools/qml/qmlruntime.cpp | 12 |
1 files changed, 12 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); |