Merge pull request #4990 from B2krobbery/fix-sni-make-unique

fix(sni): use std::make_unique for Item allocation
This commit is contained in:
Alexis Rouillard
2026-04-22 20:50:48 +02:00
committed by GitHub
+5 -3
View File
@@ -178,9 +178,11 @@ void Host::addRegisteredItem(const std::string& service) {
return bus_name == item->bus_name && object_path == item->object_path;
});
if (it == items_.end()) {
items_.emplace_back(new Item(
bus_name, object_path, config_, bar_, [this](Item& item) { itemReady(item); },
[this](Item& item) { itemInvalidated(item); }, on_update_));
items_.emplace_back(std::make_unique<Item>(
bus_name, object_path, config_, bar_,
[this](Item& item) { itemReady(item); },
[this](Item& item) { itemInvalidated(item); },
on_update_));
}
}