add gui.alert & critical fixes

This commit is contained in:
MihailRis
2025-01-02 21:59:18 +03:00
parent b9ff1db086
commit a3d35cd10f
7 changed files with 52 additions and 25 deletions
+4 -2
View File
@@ -12,7 +12,7 @@ namespace util {
int nextid = 1;
std::unordered_map<int, std::function<bool(Types...)>> handlers;
std::vector<int> order;
std::mutex mutex;
std::recursive_mutex mutex;
public:
HandlersList() = default;
@@ -45,7 +45,9 @@ namespace util {
void notify(Types...args) {
std::lock_guard lock(mutex);
for (auto it = order.rbegin(); it != order.rend(); ++it) {
auto orderCopy = order;
for (auto it = orderCopy.rbegin(); it != orderCopy.rend(); ++it) {
if (handlers.at(*it)(args...)) {
break;
}