mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
fix crash with unloadAll
This commit is contained in:
parent
3293f37662
commit
ab85578dce
1 changed files with 6 additions and 1 deletions
|
@ -180,6 +180,8 @@ void CConfigManager::handleUnload(const std::string& COMMAND, const std::string&
|
|||
}
|
||||
|
||||
void CConfigManager::handleUnloadAll(const std::string& COMMAND, const std::string& VALUE) {
|
||||
std::vector<std::string> toUnload;
|
||||
|
||||
for (auto&[name, target] : g_pHyprpaper->m_mWallpaperTargets) {
|
||||
|
||||
bool exists = false;
|
||||
|
@ -193,6 +195,9 @@ void CConfigManager::handleUnloadAll(const std::string& COMMAND, const std::stri
|
|||
if (exists)
|
||||
continue;
|
||||
|
||||
g_pHyprpaper->unloadWallpaper(name);
|
||||
toUnload.emplace_back(name);
|
||||
}
|
||||
|
||||
for (auto& tu : toUnload)
|
||||
g_pHyprpaper->unloadWallpaper(tu);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue