this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1352 from CKegel/LaunchServices_patch

Rewrite LSINFO getDatabaseQueue in LaunchServices to be Threadsafe

authored by

CuriousTommy and committed by
GitHub
9dcf75cf 20b1b34f

+4 -4
+4 -4
src/frameworks/CoreServices/src/LaunchServices/LSInfo.m
··· 28 28 __attribute__((visibility("hidden"))) 29 29 FMDatabaseQueue* getDatabaseQueue(void) 30 30 { 31 - static FMDatabaseQueue* db = nil; 32 - if (!db) 33 - { 31 + static dispatch_once_t pred; 32 + static FMDatabaseQueue* db; 33 + dispatch_once(&pred, ^{ 34 34 db = [[FMDatabaseQueue databaseQueueWithPath: @"/private/var/db/launchservices.db" flags:SQLITE_OPEN_READONLY] retain]; 35 - } 35 + }); 36 36 return db; 37 37 } 38 38