diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs index 62f4af3b..e4492d32 100644 --- a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs +++ b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs @@ -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)) {