1
0
mirror of https://github.com/bitwarden/mobile synced 2025-01-08 15:21:51 +01:00

Reset IOC resolver since it seems static references hang around between extension launches

This commit is contained in:
Kyle Spearrin 2016-08-09 20:00:55 -04:00
parent d3b1fed9b7
commit e026a8fea2

View File

@ -36,11 +36,8 @@ namespace Bit.iOS.Extension
{ } { }
public override void ViewDidLoad() public override void ViewDidLoad()
{
if(!Resolver.IsSet)
{ {
SetIoc(); SetIoc();
}
base.ViewDidLoad(); base.ViewDidLoad();
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f); View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
@ -255,6 +252,7 @@ namespace Bit.iOS.Extension
{ {
NSRunLoop.Main.BeginInvokeOnMainThread(() => NSRunLoop.Main.BeginInvokeOnMainThread(() =>
{ {
Resolver.ResetResolver();
ExtensionContext.CompleteRequest(returningItems, null); ExtensionContext.CompleteRequest(returningItems, null);
}); });
}); });
@ -292,7 +290,7 @@ namespace Bit.iOS.Extension
ISettings settings = new Settings("group.com.8bit.bitwarden"); ISettings settings = new Settings("group.com.8bit.bitwarden");
container.RegisterInstance(settings, new ContainerControlledLifetimeManager()); container.RegisterInstance(settings, new ContainerControlledLifetimeManager());
Resolver.SetResolver(new UnityResolver(container)); Resolver.ResetResolver(new UnityResolver(container));
} }
private bool ProcessItemProvider(NSItemProvider itemProvider, string type, Action<NSDictionary> action) private bool ProcessItemProvider(NSItemProvider itemProvider, string type, Action<NSDictionary> action)