Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.0.0, 5.1.0 , 5.2.0, 5.3.0, 5.3.1
-
None
-
Debian 7.5 Linux xcb
Description
An application creates QOpenGLContext, then calls other functions like QWebKit to draw, which calls QGLContext::fromOpenGLContext to get a QGLContext. QGLContext::fromOpenGLContext will create a QGLContext using QGLContext::QGLContext(QOpenGLContext *context) if the QOpenGLContext doesn't already have one associated. The problem is while a delete function is passed to QOpenGLContext and QOpenGLContext::deleteQGLContext exists, nothing calls that function leaving the QGLContext to leak, and the application to crash on exit as resources associated with that context are being released, the crash is probably due to QGLContext having a dangling pointer to QOpenGLContext.
QOpenGLContext::deleteQGLContext was last being called from QWindow::destroy() in commit 4a189c188ccd2fb5f8d1d5ddadf06cbd6bc0916f
I'll provide a link to codereview with a fix shortly. Basically I call deleteQGLContext from QOpenGLContext::destroy with another change to make who QGLContext or QOpenGLContext "own" the other clear so the owner deletes the other.