mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 14:35:57 +01:00
screencopy: safer iteration of vector in destroyStream
This commit is contained in:
parent
716da5e0f3
commit
11009ba077
1 changed files with 6 additions and 0 deletions
|
@ -1009,7 +1009,13 @@ void CPipewireConnection::destroyStream(CScreencopyPortal::SSession* pSession) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!PSTREAM->buffers.empty()) {
|
if (!PSTREAM->buffers.empty()) {
|
||||||
|
std::vector<SBuffer*> bufs;
|
||||||
|
|
||||||
for (auto& b : PSTREAM->buffers) {
|
for (auto& b : PSTREAM->buffers) {
|
||||||
|
bufs.push_back(b.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& b : bufs) {
|
||||||
pwStreamRemoveBuffer(PSTREAM, b->pwBuffer);
|
pwStreamRemoveBuffer(PSTREAM, b->pwBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue