Corrected order of PostProcessor desctruction calls to follow Spring Java Container

This commit is contained in:
Thomas Trageser
2012-08-13 23:09:32 +01:00
parent c94a55b5e8
commit 441cf45e58

View File

@@ -1441,6 +1441,9 @@ namespace Spring.Objects.Factory.Support
log.Debug(m => m("Destroying dependant objects for object '{0}", name));
DestroyDependantObjects(name);
ApplyObjectPostProcessBeforeDestruction(target, name);
if (target is IDisposable)
{
log.Debug(m => m(string.Format(CultureInfo.InvariantCulture, "Calling Dispose() on object with name '{0}'.", name)));
@@ -1455,8 +1458,6 @@ namespace Spring.Objects.Factory.Support
}
}
ApplyObjectPostProcessBeforeDestruction(target, name);
RootObjectDefinition rootDefinition = GetMergedObjectDefinition(name, false);
if (rootDefinition != null && StringUtils.HasText(rootDefinition.DestroyMethodName))
{