public void InsertImage(Data.GroupingElement elem) { imageQueue.Insert(elem); while (imageQueue.Count > Core.Config.BehaviorConfig.PrefetchConfig.PrefetchKeepMaximum) { var deq = imageQueue.Pop(); if (!deq.IsBuffered) { continue; } try { deq.BufferedImage.Dispose(); } finally { deq.BufferedImage = null; } } }
public void InsertThumbnail(Data.GroupingElement elem) { thumbnailQueue.Insert(elem); if (Core.Config.BehaviorConfig.PrefetchConfig.KeepAllThumbnail) { return; } while (imageQueue.Count > Core.Config.BehaviorConfig.PrefetchConfig.ThumbnailKeepMaximum) { var deq = thumbnailQueue.Pop(); if (!deq.IsBuffered) { continue; } try { deq.BufferedImage.Dispose(); } finally { deq.BufferedImage = null; } } }