Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.5.1, 5.11.1, 5.11.2
-
None
-
-
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).