mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
fix logic in buffer cleaning
This commit is contained in:
parent
88885b21a9
commit
f75fcf01d1
1 changed files with 4 additions and 5 deletions
|
@ -82,10 +82,12 @@ void CHyprpaper::unloadWallpaper(const std::string& path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean buffers
|
// clean buffers
|
||||||
for (auto it = m_vBuffers.begin(); it != m_vBuffers.end(); it++) {
|
for (auto it = m_vBuffers.begin(); it != m_vBuffers.end();) {
|
||||||
|
|
||||||
if (it->get()->target != path)
|
if (it->get()->target != path) {
|
||||||
|
it++;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const auto PRELOADPATH = it->get()->name;
|
const auto PRELOADPATH = it->get()->name;
|
||||||
|
|
||||||
|
@ -96,9 +98,6 @@ void CHyprpaper::unloadWallpaper(const std::string& path) {
|
||||||
destroyBuffer(it->get());
|
destroyBuffer(it->get());
|
||||||
|
|
||||||
it = m_vBuffers.erase(it);
|
it = m_vBuffers.erase(it);
|
||||||
|
|
||||||
if (it == m_vBuffers.end())
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mWallpaperTargets.erase(path); // will free the cairo surface
|
m_mWallpaperTargets.erase(path); // will free the cairo surface
|
||||||
|
|
Loading…
Reference in a new issue