Fix heap-use-after-free with rhi-based backingstore
Task-number: QTBUG-102030 Change-Id: I6b05007c6ae3d653197c5680b9fc5768b0e3690f Reviewed-by: Michal Klocek <michal.klocek@qt.io>bb10
parent
7e4c2ac711
commit
a86ee60887
|
|
@ -219,11 +219,12 @@ bool QBackingStoreRhiSupportWindowWatcher::eventFilter(QObject *obj, QEvent *eve
|
|||
auto it = m_rhiSupport->m_swapchains.find(window);
|
||||
if (it != m_rhiSupport->m_swapchains.end()) {
|
||||
qCDebug(lcQpaBackingStore) << "SurfaceAboutToBeDestroyed received for tracked window" << window << "cleaning up swapchain";
|
||||
it->reset();
|
||||
auto data = *it;
|
||||
m_rhiSupport->m_swapchains.erase(it);
|
||||
data.reset(); // deletes 'this'
|
||||
}
|
||||
}
|
||||
return QObject::eventFilter(obj, event);
|
||||
return false;
|
||||
}
|
||||
|
||||
QSurface::SurfaceType QBackingStoreRhiSupport::surfaceTypeForConfig(const QPlatformBackingStoreRhiConfig &config)
|
||||
|
|
|
|||
Loading…
Reference in New Issue