How to remove the EntryWidget object of List correctly?

After executing the following code, the OnEntryReleased event cannot be triggered.


20230103-162740

You do not need to remove widgets from the list view - the loop is not needed here at all. The only thing you need to do is to remove the item - the data used to construct the widget.

image

Once the item is removed, the list view will remove the widget. Removing the item triggers OnEntryReleased. At least it does so under regular circumstances. Is it not what you’re experiencing?

Why does the widget object still exist when Clear List Items?

Because the Garbage Collection has yet to kick in. It groups objects into clusters before removing them. It may take a minute to have the memory released.

Also, Debugger does not always tell the entire truth.

Is there any way to delete it immediately?

But you’re better off not using it.