From 478a5826a00fdbbf32d2e942484d261fa07c79be Mon Sep 17 00:00:00 2001 From: andrzej Date: Thu, 23 Feb 2006 03:10:47 +0000 Subject: [PATCH] Clear the snapshot array when we're done applying an op so that we don't retain references that will interfere with garbage collection. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1792 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/ObserverList.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/util/ObserverList.java b/src/java/com/samskivert/util/ObserverList.java index f8d5e499..821e30e9 100644 --- a/src/java/com/samskivert/util/ObserverList.java +++ b/src/java/com/samskivert/util/ObserverList.java @@ -4,6 +4,7 @@ package com.samskivert.util; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import com.samskivert.Log; @@ -191,7 +192,9 @@ public class ObserverList extends ArrayList remove(_snap[ii]); } } - + // clear out the snapshot so its contents can be gc'd + Arrays.fill(_snap, null); + } else if (_policy == FAST_UNSAFE_NOTIFY) { int ocount = size(); for (int ii = ocount-1; ii >= 0; ii--) {