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

Copied QOpenGLFunctions Core objects crash in destructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.13.0 Alpha 1
    • 5.5.1, 5.11.1, 5.11.2
    • GUI: OpenGL
    • None
    • All
    • f7ba6a0acfeb04b5ac0018ae42eda65398a47fd4 (qt/qtbase/dev)

    Description

      When a QOpenGLFunctions Core object is copied, we encountered a crash during the destruction of the object.

      Christian Ehrlicher suggested me to report this issue to you:

      https://forum.qt.io/topic/95927/crash-when-copying-qopenglfunctions-core-objects

      Example (from the forum):

       

       

        #include <QOpenGLFunctions_4_5_Core>
      
        void CopyCoreObjects()
        {
          {
            QOpenGLFunctions_4_5_Core coreObject1;
            {
              QOpenGLFunctions_4_5_Core coreObject2 = coreObject1;
            }  // OK, calls ~QOpenGLFunctions_4_5_Core().
      
          } // Crash!
        }
      

       

      This issue appears to exist for all QOpenGLFunctions Core classes (from QOpenGLFunctions_3_2_Core to QOpenGLFunctions_4_5_Core).

      The easiest way to solve this issue seems to be just to prevent accidental copying of QOpenGLFunctions Core objects, by marking the copy-constructor and the assignment-operator of the Core classes as deleted member functions (using C++11 "= delete" syntax).

       

       

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            niels-dekker Niels Dekker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes