fix(sni): use std::make_unique for Item allocation

This commit is contained in:
B2krobbery
2026-04-16 18:34:39 +05:30
parent 3a321d934d
commit 7e9c46e4d1
+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; return bus_name == item->bus_name && object_path == item->object_path;
}); });
if (it == items_.end()) { if (it == items_.end()) {
items_.emplace_back(new Item( items_.emplace_back(std::make_unique<Item>(
bus_name, object_path, config_, bar_, [this](Item& item) { itemReady(item); }, bus_name, object_path, config_, bar_,
[this](Item& item) { itemInvalidated(item); }, on_update_)); [this](Item& item) { itemReady(item); },
[this](Item& item) { itemInvalidated(item); },
on_update_));
} }
} }