Zoomicon / READCOM_App

READ-COM: Reading Communities App
MIT License
11 stars 5 forks source link

StructureView takes increasing time every time it is refreshed #250

Closed birbilis closed 1 year ago

birbilis commented 1 year ago

Version: 0.6.0

StructureView takes increasing time every time it is refreshed, especially noticeable when opening/closing it in Edit mode and/or when loading new stories with lots of items

birbilis commented 1 year ago

Now doing:

 with ImageList do
 begin
    Dormant := false; //this is the default

    ClearCache;
    CacheSize := 100; //does not allow to set CacheSize to 0

    Source.ClearAndResetID;
    Destination.ClearAndResetID;
 end;
birbilis commented 1 year ago

Also had an AddFreeNotify without a paired RemoveFreeNotify and was accidentally passing the TreeViewItem's Self (since it was inside a With TreeViewItem statement) instead of passing it the StructureView instance. Strangely it seemed to remove the TreeViewItems from the tree

However decided to do FreeNotification and RemoveFreeNotification instead, seems to work better Doing first a RemoveFreeNotification in case the item was already monitored by the StructureView, then the FreeNotification