C++ FilterModel: Fix mix of unique_ptr and shared_ptr

The inner is sorted in a shared_ptr and should be created using make_shared.
This commit is contained in:
Simon Hausmann 2022-09-27 14:15:38 +02:00
parent 56983482b9
commit 388cf32770

View file

@ -952,7 +952,7 @@ public:
/// FilterModel.
FilterModel(std::shared_ptr<Model<ModelData>> source_model,
std::function<bool(const ModelData &)> filter_fn)
: inner(std::make_unique<private_api::FilterModelInner<ModelData>>(
: inner(std::make_shared<private_api::FilterModelInner<ModelData>>(
std::move(source_model), std::move(filter_fn), *this))
{
inner->source_model->attach_peer(inner);