aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth
diff options
context:
space:
mode:
authorGravatar Paul Beusterien <paulbeusterien@google.com>2018-06-25 10:48:09 -0700
committerGravatar GitHub <noreply@github.com>2018-06-25 10:48:09 -0700
commit19e0c0bb6ab4e3fdbc72acf9bd967e1ffaa3866d (patch)
tree4e893e83133cbb0b0c8540f86ea0fb4a9597b6a4 /Firebase/Auth
parent47ab39aee6330f59263b0a9b2fc36536544651fd (diff)
Fix data race issue caught by sanitizer (#1446)
Diffstat (limited to 'Firebase/Auth')
-rw-r--r--Firebase/Auth/Source/FIRAuthAppDelegateProxy.m14
1 files changed, 7 insertions, 7 deletions
diff --git a/Firebase/Auth/Source/FIRAuthAppDelegateProxy.m b/Firebase/Auth/Source/FIRAuthAppDelegateProxy.m
index 3289b4e..73fbfda 100644
--- a/Firebase/Auth/Source/FIRAuthAppDelegateProxy.m
+++ b/Firebase/Auth/Source/FIRAuthAppDelegateProxy.m
@@ -205,14 +205,14 @@ static BOOL isIOS9orLater() {
// iOS App extensions should not call [UIApplication sharedApplication], even if UIApplication
// responds to it.
static Class applicationClass = nil;
- if (![FIRAppEnvironmentUtil isAppExtension]) {
- Class cls = NSClassFromString(@"UIApplication");
- if (cls && [cls respondsToSelector:NSSelectorFromString(@"sharedApplication")]) {
- applicationClass = cls;
- }
- }
- UIApplication *application = [applicationClass sharedApplication];
dispatch_once(&onceToken, ^{
+ if (![FIRAppEnvironmentUtil isAppExtension]) {
+ Class cls = NSClassFromString(@"UIApplication");
+ if (cls && [cls respondsToSelector:NSSelectorFromString(@"sharedApplication")]) {
+ applicationClass = cls;
+ }
+ }
+ UIApplication *application = [applicationClass sharedApplication];
sharedInstance = [[self alloc] initWithApplication:application];
});
return sharedInstance;