Merge pull request #1209 from APriestman/incorrectThumbnails

Clear out Image Gallery thumbnail cache to prevent images from closed cases from being re-used.
This commit is contained in:
Richard Cordovano 2015-04-23 13:59:13 -04:00
commit d9d7217c14
2 changed files with 8 additions and 0 deletions

View File

@ -348,6 +348,7 @@ public final class ImageGalleryController {
LOGGER.info("resetting ImageGalleryControler to initial state."); LOGGER.info("resetting ImageGalleryControler to initial state.");
selectionModel.clearSelection(); selectionModel.clearSelection();
setListeningEnabled(false); setListeningEnabled(false);
ThumbnailCache.getDefault().clearCache();
Platform.runLater(() -> { Platform.runLater(() -> {
historyManager.clear(); historyManager.clear();
}); });

View File

@ -83,6 +83,13 @@ public enum ThumbnailCache {
/** thread that saves generated thumbnails to disk for use later */ /** thread that saves generated thumbnails to disk for use later */
private final Executor imageSaver = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("icon saver-%d").build()); private final Executor imageSaver = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("icon saver-%d").build());
/**
* Clear out the cache between cases
*/
public final void clearCache() {
cache.invalidateAll();
}
/** get the cached thumbnail for the given file or generate a new one if /** get the cached thumbnail for the given file or generate a new one if
* needed * needed
* *