Using ShellContext.Dispose() where applicable

This commit is contained in:
Lombiq
2014-08-13 15:58:31 +02:00
committed by Zoltán Lehóczky
parent c08ba79d6e
commit 64eb4725bc

View File

@@ -277,7 +277,7 @@ namespace Orchard.Environment {
// terminate the shell if the tenant was disabled
else if (settings.State == TenantState.Disabled) {
shellContext.Shell.Terminate();
shellContext.LifetimeScope.Dispose();
shellContext.Dispose();
_runningShellTable.Remove(settings);
_shellContexts = _shellContexts.Where(shell => shell.Settings.Name != settings.Name);
@@ -286,7 +286,7 @@ namespace Orchard.Environment {
else {
// dispose previous context
shellContext.Shell.Terminate();
shellContext.LifetimeScope.Dispose();
shellContext.Dispose();
var context = _shellContextFactory.CreateShellContext(settings);