Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40286

QGLContext created with fromOpenGLContext not deallocated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.0.0, 5.1.0 , 5.2.0, 5.3.0, 5.3.1
    • GUI: OpenGL
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            david@fries.net David Fries
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes