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
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
package com.samskivert.util;
|
package com.samskivert.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import com.samskivert.Log;
|
import com.samskivert.Log;
|
||||||
@@ -191,7 +192,9 @@ public class ObserverList extends ArrayList
|
|||||||
remove(_snap[ii]);
|
remove(_snap[ii]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// clear out the snapshot so its contents can be gc'd
|
||||||
|
Arrays.fill(_snap, null);
|
||||||
|
|
||||||
} else if (_policy == FAST_UNSAFE_NOTIFY) {
|
} else if (_policy == FAST_UNSAFE_NOTIFY) {
|
||||||
int ocount = size();
|
int ocount = size();
|
||||||
for (int ii = ocount-1; ii >= 0; ii--) {
|
for (int ii = ocount-1; ii >= 0; ii--) {
|
||||||
|
|||||||
Reference in New Issue
Block a user