We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d41c638 commit 69afac1Copy full SHA for 69afac1
Sources/KSCrashRecording/Monitors/KSCrashMonitor_System.m
@@ -292,14 +292,12 @@ static uint64_t usableMemory(void)
292
*/
293
static inline bool isJailbroken(void)
294
{
295
- static bool initialized_jb;
296
- static bool is_jb;
297
- if (!initialized_jb) {
298
- get_jailbreak_status(&is_jb);
299
- initialized_jb = true;
300
- }
301
-
302
- return is_jb;
+ static bool is_jailbroken;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ get_jailbreak_status(&is_jailbroken);
+ });
+ return is_jailbroken;
303
}
304
305
/** Check if the current build is a debug build.
0 commit comments