Skip to content

Commit

Permalink
Remove isInitialized checked prior to obtaining initLock
Browse files Browse the repository at this point in the history
  • Loading branch information
brismithers committed Nov 14, 2023
1 parent f89a829 commit 6b958ec
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,8 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
): Boolean {
Logging.log(LogLevel.DEBUG, "initWithContext(context: $context, appId: $appId)")

// do not do this again if already initialized
if (isInitialized) {
Logging.log(LogLevel.DEBUG, "initWithContext: SDK already initialized")
return true
}

synchronized(initLock) {
// check whether we've been initialized again, now that we have the lock
// do not do this again if already initialized
if (isInitialized) {
Logging.log(LogLevel.DEBUG, "initWithContext: SDK already initialized")
return true
Expand Down

0 comments on commit 6b958ec

Please sign in to comment.