summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-01-18 13:07:56 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-01-21 08:28:31 +0000
commitebffedb11dbce9391982dd3646b5466103aa5705 (patch)
treeaf93d2814e690a968c6525c60414d13e021cd459 /src/widgets/doc
parent578154c47dfeaf9eb7f7ed428b876314fc239350 (diff)
Avoid trashing other contexts' VAOs in destroy()
The following is safe: QOpenGLVertexArrayObject *vao = ... vao->create(); switch the current context delete vao; because the QOpenGLVAO dtor recognizes that the wrong context is current, and will temporarily restore the VAO's associated one in order to safely destroy the vao object. However, the following has been problematic: vao.create(); switch the current context vao.destroy(); simply because all the logic was in the dtor and destroy() blindly deleted the vao object in whatever context was current. This can lead to releasing a completely unrelated vao object that happens to have the same name in another context. The expectation is for context-dependent wrappers is that a ctor-create-dtor-ctor-create-dtor-... sequence is equivalent to create-destroy-create-destroy-..., so move the safe cleanup logic from the dtor to destroy(). Change-Id: Ie3bddbf4bfeb8629948c4783cc88422c9df03e65 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/widgets/doc')
0 files changed, 0 insertions, 0 deletions