wayland: Properly clear transaction list in TransactionDmaBufLocker
Transaction::unlock() can destroy buffer reference and thus also destroy TransactionDmaBufLocker.
This commit is contained in:
parent
00c12aa766
commit
693fa8a968
1 changed files with 3 additions and 2 deletions
|
@ -45,10 +45,11 @@ TransactionDmaBufLocker::TransactionDmaBufLocker(const DmaBufAttributes *attribu
|
||||||
notifier->setEnabled(false);
|
notifier->setEnabled(false);
|
||||||
m_pending.removeOne(notifier);
|
m_pending.removeOne(notifier);
|
||||||
if (m_pending.isEmpty()) {
|
if (m_pending.isEmpty()) {
|
||||||
for (Transaction *transition : std::as_const(m_transactions)) {
|
const auto transactions = m_transactions; // unlock() may destroy this
|
||||||
|
m_transactions.clear();
|
||||||
|
for (Transaction *transition : transactions) {
|
||||||
transition->unlock();
|
transition->unlock();
|
||||||
}
|
}
|
||||||
m_transactions.clear();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m_notifiers.emplace_back(notifier);
|
m_notifiers.emplace_back(notifier);
|
||||||
|
|
Loading…
Reference in a new issue