Make sure the flag that a memory warning was received is persisted right away

NSUserDefaults may not synchronize changes immediately, so if the kill happens before it persists changes, the information is lost.
This commit is contained in:
Andreas Linde 2014-02-10 13:10:10 +01:00
parent cc480299eb
commit 4d414b78f4

View File

@ -346,6 +346,7 @@ NSString *const kBITFakeCrashReport = @"BITFakeCrashAppString";
// we only need to log this once
if (!_didLogLowMemoryWarning) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kBITAppDidReceiveLowMemoryNotification];
[[NSUserDefaults standardUserDefaults] synchronize];
_didLogLowMemoryWarning = YES;
}
}];