Changeset 430

Show
Ignore:
Timestamp:
08/18/08 18:35:13 (3 months ago)
Author:
saurik
Message:

Added support for seatbelt'd temporary folders.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/data/sqlite3/tempdir.diff

    r413 r430  
    3737      "/usr/tmp", 
    3838      "/tmp", 
    39 @@ -2509,6 +2514,11 @@ 
     39@@ -2509,6 +2514,12 @@ 
    4040   int i, j; 
    4141   struct stat buf; 
    4242   const char *zDir = "."; 
    4343+#ifdef __APPLE__ 
     44+  void *pool; 
    4445+  CFStringRef cfstr; 
    4546+  CFIndex maxsize; 
     
    5556+#ifdef __APPLE__ 
    5657+  if (azDirs[1] == NULL) { 
    57 +    NSPushAutoreleasePool(); 
     58+    pool = NSPushAutoreleasePool(0); 
    5859+    cfstr = (CFStringRef) NSTemporaryDirectory(); 
    5960+    maxsize = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), kCFStringEncodingUTF8) + 1; 
     
    6162+    CFStringGetCString(cfstr, cstr, maxsize, kCFStringEncodingUTF8); 
    6263+    azDirs[1] = cstr; 
    63 +    NSPopAutoreleasePool(); 
     64+    NSPopAutoreleasePool(pool); 
    6465+  } 
    6566+#endif