From 2cc93f74b531c653fde19c52f925b20b04c69b36 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 10 Sep 2009 07:42:20 +0200 Subject: Autotest preventing gl from crashing on shutdown with dangling contexts --- tests/auto/qgl/tst_qgl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index ebbfbae..a0b8b5d 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -81,6 +81,8 @@ private slots: void stackedFBOs(); void colormap(); void fboFormat(); + + void testDontCrashOnDanglingResources(); }; tst_QGL::tst_QGL() @@ -1513,5 +1515,16 @@ void tst_QGL::fboFormat() QVERIFY(format1c != format4c); } +void tst_QGL::testDontCrashOnDanglingResources() +{ + // We have a number of Q_GLOBAL_STATICS inside the QtOpenGL + // library. This test is verify that we don't crash as a result of + // them calling into libgl on application shutdown. + QWidget *widget = new UnclippedWidget(); + widget->show(); + qApp->processEvents(); + widget->hide(); +} + QTEST_MAIN(tst_QGL) #include "tst_qgl.moc" -- cgit v0.12