mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-19 18:56:31 +00:00
Removing synchronize calls as they are async anyway
check http://dscoder.com/defaults.html by the engineer who actually works on NSUserDefaults
This commit is contained in:
@@ -960,7 +960,6 @@ static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44};
|
||||
} else {
|
||||
[defaults setObject:lastAuthenticatedVersion
|
||||
forKey:kBITAuthenticatorLastAuthenticatedVersionKey];
|
||||
[defaults synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -521,7 +521,6 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
|
||||
// we only need to log this once
|
||||
if (!_didLogLowMemoryWarning) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kBITAppDidReceiveLowMemoryNotification];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
_didLogLowMemoryWarning = YES;
|
||||
}
|
||||
}];
|
||||
@@ -548,7 +547,6 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
|
||||
- (void)leavingAppSafely {
|
||||
if (self.isAppNotTerminatingCleanlyDetectionEnabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kBITAppWentIntoBackgroundSafely];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1274,7 +1272,6 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
|
||||
#endif
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:kBITAppDidReceiveLowMemoryNotification];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
[self triggerDelayedProcessing];
|
||||
BITHockeyLogVerbose(@"VERBOSE: CrashManager startManager has finished.");
|
||||
|
||||
@@ -118,7 +118,6 @@ static NSString *const BITMetricsURLPathString = @"v2/track";
|
||||
|
||||
- (void)updateDidEnterBackgroundTime {
|
||||
[self.userDefaults setDouble:[[NSDate date] timeIntervalSince1970] forKey:kBITApplicationDidEnterBackgroundTime];
|
||||
[self.userDefaults synchronize];
|
||||
}
|
||||
|
||||
- (void)startNewSessionIfNeeded {
|
||||
@@ -150,7 +149,6 @@ static NSString *const BITMetricsURLPathString = @"v2/track";
|
||||
if (![self.userDefaults boolForKey:kBITApplicationWasLaunched]) {
|
||||
session.isFirst = @"true";
|
||||
[self.userDefaults setBool:YES forKey:kBITApplicationWasLaunched];
|
||||
[self.userDefaults synchronize];
|
||||
} else {
|
||||
session.isFirst = @"false";
|
||||
}
|
||||
|
||||
@@ -165,8 +165,6 @@
|
||||
[self.userDefaults removeObjectForKey:kBITStoreUpdateLastStoreVersion];
|
||||
versionString = nil;
|
||||
}
|
||||
|
||||
[self.userDefaults synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user