summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-09-10 05:24:55 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-09-10 05:30:10 (GMT)
commit5f24d8930838f0d3cb622f9937a171eb6734df1a (patch)
treecb59bbd84229cb5d52f4d138566a90d458d2d432 /src/opengl
parent66dc9221163a6b225cdfa351b8df7a01f6ce7bf0 (diff)
downloadQt-5f24d8930838f0d3cb622f9937a171eb6734df1a.zip
Qt-5f24d8930838f0d3cb622f9937a171eb6734df1a.tar.gz
Qt-5f24d8930838f0d3cb622f9937a171eb6734df1a.tar.bz2
Fixed crash on shutdown with GL when leaking QGLWidgets
The problem was the QGLContextResource destructor which was called when the QtOpenGL dll was unloaded. At this point in time, the gl driver had already been unloaded so any gl calls at this point in time would crash. It is simply wrong for the destructor to try to clean up, so we instead output a warning if resources are leaked.
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 3e30fe4..65d6f99 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -4916,8 +4916,13 @@ QGLContextResource::QGLContextResource(FreeFunc f, QObject *parent)
QGLContextResource::~QGLContextResource()
{
- while (!m_resources.empty())
- removeGroup(m_resources.begin().key());
+#ifndef QT_NO_DEBUG
+ if (m_resources.size()) {
+ qWarning("QtOpenGL: Resources are still available at program shutdown.\n"
+ " This is possibly caused by a leaked QGLWidget, \n"
+ " QGLFrameBufferObject or QGLPixelBuffer.");
+ }
+#endif
}
void QGLContextResource::insert(const QGLContext *key, void *value)