Skip to content

Commit

Permalink
merge of the actual 3.0 into the 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
senivam committed Aug 2, 2024
2 parents 4de62ad + 845ab16 commit a183023
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public final class NonInjectionManager implements InjectionManager {
*/
private class TypedInstances<TYPE> {
private final MultivaluedMap<TYPE, InstanceContext<?>> singletonInstances = new MultivaluedHashMap<>();
private final ThreadLocal<MultivaluedMap<TYPE, InstanceContext<?>>> threadInstances = new ThreadLocal<>();
private ThreadLocal<MultivaluedMap<TYPE, InstanceContext<?>>> threadInstances = new ThreadLocal<>();
private final List<Object> threadPredestroyables = Collections.synchronizedList(new LinkedList<>());
private final ReentrantLock singletonInstancesLock = new ReentrantLock();

Expand Down Expand Up @@ -203,6 +203,8 @@ <T> T getInstance(TYPE clazz, Annotation[] annotations) {
void dispose() {
singletonInstances.forEach((clazz, instances) -> instances.forEach(instance -> preDestroy(instance.getInstance())));
threadPredestroyables.forEach(NonInjectionManager.this::preDestroy);
/* The java.lang.ThreadLocal$ThreadLocalMap$Entry[] keeps references to this NonInjectionManager */
threadInstances = null;
}
}

Expand Down

0 comments on commit a183023

Please sign in to comment.