fix(sni): use std::make_unique for Item allocation
This commit is contained in:
@@ -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_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user