private async Task DocumentClosed(IDocument doc) { var envs = _documentRegister.OpenDocuments.OfType <MapDocument>().Select(x => x.Environment).ToHashSet(); _resourceCollection.DisposeOtherEnvironments(envs); if (_activeDocument.TryGetTarget(out var md) && md == doc) { await UpdateScene(null, null); } }