Fix crash when a widget is cached with an old Todo object
When editing one or more todo items, some items may not have changed, therefore having the exact same source text. The EditCommand still deletes the Todo instance and creates a new one and puts it in the todo list. But the widget cache only looked at the source text, found a widget from before the edit and will use it. But the widget still has a reference to the old Todo instance. When executing an action on it (e.g. mark it as complete), the TodoList doesn't remember that todo item, which results in a crash. Fixed by updating the reference to the latest Todo instance when the sources are equal but the instances are not.
Showing
Please register or sign in to comment