Avoid cleaning registration maps when an instance is disposed. This avoids the injection of null when a callback is called after the instance destruction.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1056666 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
index dbebc19..3c9d24a 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
@@ -430,11 +430,9 @@
synchronized (this) {
m_factory.disposed(this);
- m_fields.clear();
- m_fieldRegistration = new HashMap();
- m_methodRegistration = new HashMap();
- m_constructorRegistration = new HashMap();
m_clazz = null;
+ // Do not clean registration map, so injection still works
+ // after disposal for late callbacks.
}
}
@@ -1062,7 +1060,6 @@
list[i].onSet(null, fieldName, result);
}
}
-
return result;
}