From e026a8fea25bde4beeb8ef1da022cb0eca130aa8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 9 Aug 2016 20:00:55 -0400 Subject: [PATCH] Reset IOC resolver since it seems static references hang around between extension launches --- src/iOS.Extension/LoadingViewController.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/iOS.Extension/LoadingViewController.cs b/src/iOS.Extension/LoadingViewController.cs index 9bbc7f7ea..44ba62f53 100644 --- a/src/iOS.Extension/LoadingViewController.cs +++ b/src/iOS.Extension/LoadingViewController.cs @@ -37,10 +37,7 @@ namespace Bit.iOS.Extension public override void ViewDidLoad() { - if(!Resolver.IsSet) - { - SetIoc(); - } + SetIoc(); base.ViewDidLoad(); 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(() => { + Resolver.ResetResolver(); ExtensionContext.CompleteRequest(returningItems, null); }); }); @@ -292,7 +290,7 @@ namespace Bit.iOS.Extension ISettings settings = new Settings("group.com.8bit.bitwarden"); container.RegisterInstance(settings, new ContainerControlledLifetimeManager()); - Resolver.SetResolver(new UnityResolver(container)); + Resolver.ResetResolver(new UnityResolver(container)); } private bool ProcessItemProvider(NSItemProvider itemProvider, string type, Action action)