mirror of
https://github.com/hyprwm/hyprlang.git
synced 2026-05-01 13:37:58 +02:00
parser: fix removed CValues not fully removed. (#90)
Leading to dangling dtor pointers when doing CConfigCustomValueTypes. Also shortstring cmp problem with handlers fixed.
This commit is contained in:
parent
d4037379e6
commit
0b21922491
1 changed files with 7 additions and 1 deletions
|
|
@ -135,6 +135,12 @@ void CConfig::removeSpecialConfigValue(const char* cat, const char* name) {
|
|||
throw "No such category";
|
||||
|
||||
std::erase_if(IT->get()->defaultValues, [name](const auto& other) { return other.first == name; });
|
||||
|
||||
for (auto& sc : impl->specialCategories) {
|
||||
if (sc->descriptor->name == cat) {
|
||||
std::erase_if(sc->values, [&](const auto& other) { return other.first == name; });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CConfig::addSpecialCategory(const char* name, SSpecialCategoryOptions options_) {
|
||||
|
|
@ -1110,7 +1116,7 @@ void CConfig::registerHandler(PCONFIGHANDLERFUNC func, const char* name, SHandle
|
|||
}
|
||||
|
||||
void CConfig::unregisterHandler(const char* name) {
|
||||
std::erase_if(impl->handlers, [name](const auto& other) { return other.name == name; });
|
||||
std::erase_if(impl->handlers, [name](const auto& other) { return std::string_view(other.name) == name; });
|
||||
}
|
||||
|
||||
bool CConfig::specialCategoryExistsForKey(const char* category, const char* key) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue