This commit is contained in:
Sven Heidemann 2020-12-25 14:53:50 +01:00
parent 08a4023a7d
commit 5db2a3f669

View File

@ -80,16 +80,16 @@ class ServiceProvider(ServiceProviderBase):
def remove_service(self, instance_type: Type[ServiceBase]):
for service in self._transient_services:
if isinstance(service, type(instance_type)):
if service == instance_type and isinstance(self._transient_services[service], type(instance_type)):
del self._transient_services[service]
return
for service in self._scoped_services:
if isinstance(service, type(instance_type)):
if service == instance_type and isinstance(self._scoped_services[service], type(instance_type)):
del self._scoped_services[service]
return
for service in self._singleton_services:
if isinstance(service, instance_type):
if service == instance_type and isinstance(self._singleton_services[service], instance_type):
del self._singleton_services[service]
return