Fix: trigger deletion causing mismatched event & action deleted (#114)

* used copied 'triggerId' instead of reference, because it will be deleted and becomes invalid .
This commit is contained in:
Zero Fanker 2024-11-06 23:54:00 -05:00 committed by GitHub
parent 11c93c3b3b
commit f7e3d96881
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 15 additions and 1635 deletions

View file

@ -220,11 +220,13 @@ public:
}
}
void RemoveByKey(const CString& key) {
bool RemoveByKey(const CString& key) {
auto const idx = this->FindIndex(key);
if (idx >= 0) {
RemoveAt(idx);
return true;
}
return false;
}
void RemoveValue(const CString& val) {
@ -384,10 +386,11 @@ public:
}
}
void RemoveValueByKey(const CString& section, const CString& key) {
bool RemoveValueByKey(const CString& section, const CString& key) {
if (auto pSec = this->TryGetSection(section)) {
pSec->RemoveByKey(key);
return pSec->RemoveByKey(key);
}
return false;
}
// ================= Iterator Related =============================