Cpp: Add a self_weak to repeated components

The main struct has it, and sub-components should have it, too.
This commit is contained in:
Simon Hausmann 2020-11-18 12:00:30 +01:00
parent ba96e8570f
commit a2839e03c2
2 changed files with 13 additions and 0 deletions

View file

@ -566,6 +566,8 @@ public:
auto &c = inner->data[i];
if (!c.ptr) {
c.ptr = { vtable::VRc<private_api::ComponentVTable, C>::make(parent) };
const_cast<C *>(&**c.ptr)->self_weak =
vtable::VWeak<private_api::ComponentVTable, C>(*c.ptr);
}
if (c.state == RepeaterInner::State::Dirty) {
(*c.ptr)->update_data(i, m->row_data(i));