platforms/drm: fix gpu removal
As soon as m_backends.removeOne(*it) returns, "it" no longer points to the same value. CCBUG: 441372
This commit is contained in:
parent
6f6944058b
commit
fbff8636b9
1 changed files with 3 additions and 3 deletions
|
@ -151,12 +151,12 @@ void EglMultiBackend::addGpu(DrmGpu *gpu)
|
|||
|
||||
void EglMultiBackend::removeGpu(DrmGpu *gpu)
|
||||
{
|
||||
auto it = std::find_if(m_backends.constBegin(), m_backends.constEnd(), [gpu](auto backend) {
|
||||
auto it = std::find_if(m_backends.begin(), m_backends.end(), [gpu](const auto &backend) {
|
||||
return backend->gpu() == gpu;
|
||||
});
|
||||
if (it != m_backends.constEnd()) {
|
||||
m_backends.removeOne(*it);
|
||||
if (it != m_backends.end()) {
|
||||
delete *it;
|
||||
m_backends.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue