item = item_factory->create_item(index);
else
item = new BasicItem(data->get_string(index));
- item->signal_autosize_changed.connect(sigc::bind(sigc::mem_fun(this, &List::item_autosize_changed), item));
add(*item);
+ item->autosize();
+ item->signal_autosize_changed.connect(sigc::bind(sigc::mem_fun(this, &List::item_autosize_changed), item));
return item;
}
void List::DataObserver::refresh_item(unsigned i)
{
delete list.items[i];
+ // Avoid stale pointer while create_item is executing
+ list.items[i] = 0;
list.items[i] = list.create_item(i);
list.items_changed();
}