From 13fefb1c178fa65d704d0dc79771b9b6ba68c943 Mon Sep 17 00:00:00 2001 From: jmillman Date: Thu, 11 Jun 2015 14:48:50 -0400 Subject: [PATCH] keep a reference to public unmodifiable view of fileids so that listeners are not immediately garbage colelcted --- .../autopsy/imagegallery/grouping/DrawableGroup.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/grouping/DrawableGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/grouping/DrawableGroup.java index 445b336ba9..779e13a815 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/grouping/DrawableGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/grouping/DrawableGroup.java @@ -41,13 +41,15 @@ public class DrawableGroup implements Comparable { } private final ObservableList fileIDs = FXCollections.observableArrayList(); + private final ObservableList unmodifiableFileIDS = FXCollections.unmodifiableObservableList(fileIDs); //cache the number of files in this groups with hashset hits private long hashSetHitsCount = -1; private final ReadOnlyBooleanWrapper seen = new ReadOnlyBooleanWrapper(false); + @SuppressWarnings("ReturnOfCollectionOrArrayField") synchronized public ObservableList fileIds() { - return FXCollections.unmodifiableObservableList(fileIDs); + return unmodifiableFileIDS; } final public GroupKey groupKey;