Avoid self-references in the created layout properties

Fixes #140
This commit is contained in:
Olivier Goffart 2021-01-28 15:06:19 +01:00
parent 52d750999b
commit 8e8c6ab690
2 changed files with 40 additions and 0 deletions

View file

@ -247,6 +247,10 @@ fn init_fake_property(
&& !grid_layout_element.borrow().bindings.contains_key(name)
{
if let Some(e) = lazy_default() {
if e.name == name && Rc::ptr_eq(&e.element.upgrade().unwrap(), grid_layout_element) {
// Don't reference self
return;
}
grid_layout_element
.borrow_mut()
.bindings