Skip to content

IServiceScope should get disposed when the associated window is destroyed or closed #8538

Open
@PureWeen

Description

@PureWeen

Currently we are creating ServiceScopes that have a life time attached to the platform windowbut we never actually dispose of the scopes.

This would be very useful behavior to have for services that are created with a service scoped life time.

Implementation of this might surface some problematic scenarios for users if they are using Service Locator pattern with long lived types. For example, a lot of users are still using App.MainPage = new MainPage(). In this scenario (and others) the xplat window/mainpage will survive the life of the platform window. This means if the user has stored the IServiceProvider locally that IServiceProvider will no longer be valid.

Metadata

Metadata

Assignees

Labels

Taskneither bug nor feature but something that needs to be done in support of eitherarea-architectureIssues with code structure, SDK structure, implementation details

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions