public void EnqueueImage(Data.GroupingElement elem) { imageQueue.Enqueue(elem); while (imageQueue.Count > Core.Config.BehaviorConfig.PrefetchConfig.PrefetchKeepMaximum) { var deq = imageQueue.Dequeue(); if (!deq.IsBuffered) { continue; } try { deq.BufferedImage.Dispose(); } finally { deq.BufferedImage = null; } } }
public void EnqueueThumbnail(Data.GroupingElement elem) { thumbnailQueue.Enqueue(elem); if (Core.Config.BehaviorConfig.PrefetchConfig.KeepAllThumbnail) { return; } while (imageQueue.Count > Core.Config.BehaviorConfig.PrefetchConfig.ThumbnailKeepMaximum) { var deq = thumbnailQueue.Dequeue(); if (!deq.IsThumbnailBuffered) { continue; } try { deq.BufferedThumbnail.Dispose(); } finally { deq.BufferedThumbnail = null; } } }