diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-30 13:01:13 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-30 13:01:13 +0100 |
commit | 4024598bd8ff73ce8f5626d30949aaa65559a655 (patch) | |
tree | 6fecabd805233fa2807c4f3e2739c12319f89705 /modules/database/db_sql.cpp | |
parent | a154532e982a1f159a7c94a1525944c7d473a687 (diff) |
Execute SQL updates atomically.
If the Serialize call alters any tables they would have previously
been missed here.
Diffstat (limited to 'modules/database/db_sql.cpp')
-rw-r--r-- | modules/database/db_sql.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index 18572b197..979ca1000 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -109,7 +109,10 @@ public: void OnNotify() override { - for (auto *obj : this->updated_items) + std::set<Serializable *> items; + std::swap(this->updated_items, items); + + for (auto *obj : items) { if (this->sql) { @@ -154,7 +157,6 @@ public: } } - this->updated_items.clear(); this->imported = true; } |