Hi !
I'm trying to make an image retriever to work with a list.
The list contains items of type (TItem) for example. TItem has some properties like title, image and imageURL.
There is a thread with the list that scan all items and try to retrieve the image of each item by using the imageURL of each item.
The thread that retrieve the image of each item work like this :
while not terminated do
begin
for i := 0 to List.count-1 do
begin
item := List.Items[i];
//Note : it can takes a few sec to retrieve the image from the imageURL. This method
//retrieve the image from the item.imageURL and then assign it to item.image
RetrieveImage(item.imageURL, item.Image);
end;
sleep(100);
end;
Unfortunately, it doesn't work in one case : when the list is cleared and that the image of an item is being retrieved by the thread.
(All items reading and writing is protected by a mutex).
What should I do ?
Thanks :)