mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Merge branch '1.8.x' into 1.x
This commit is contained in:
commit
5bebeb85f0
@ -277,22 +277,25 @@ namespace Orchard.Environment {
|
||||
// terminate the shell if the tenant was disabled
|
||||
else if (settings.State == TenantState.Disabled) {
|
||||
shellContext.Shell.Terminate();
|
||||
shellContext.Dispose();
|
||||
_runningShellTable.Remove(settings);
|
||||
|
||||
_shellContexts = _shellContexts.Where(shell => shell.Settings.Name != settings.Name);
|
||||
// Forcing enumeration with ToArray() so a lazy execution isn't causing issues by accessing the disposed context.
|
||||
_shellContexts = _shellContexts.Where(shell => shell.Settings.Name != settings.Name).ToArray();
|
||||
|
||||
shellContext.Dispose();
|
||||
}
|
||||
// reload the shell as its settings have changed
|
||||
else {
|
||||
// dispose previous context
|
||||
shellContext.Shell.Terminate();
|
||||
shellContext.Dispose();
|
||||
|
||||
var context = _shellContextFactory.CreateShellContext(settings);
|
||||
|
||||
// activate and register modified context
|
||||
_shellContexts = _shellContexts.Where(shell => shell.Settings.Name != settings.Name).Union(new[] { context });
|
||||
// Sctivate and register modified context.
|
||||
// Forcing enumeration with ToArray() so a lazy execution isn't causing issues by accessing the disposed shell context.
|
||||
_shellContexts = _shellContexts.Where(shell => shell.Settings.Name != settings.Name).Union(new[] { context }).ToArray();
|
||||
|
||||
shellContext.Dispose();
|
||||
context.Shell.Activate();
|
||||
|
||||
_runningShellTable.Update(settings);
|
||||
|
Loading…
Reference in New Issue
Block a user