diff options
author | Oz Linden <oz@lindenlab.com> | 2012-12-17 10:15:01 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-12-17 10:15:01 -0500 |
commit | 36222cfa8c6960372acf10938a16fefe2a210259 (patch) | |
tree | c4d4b65bdf3aa636c0c563b3c14a8e56e28951cb /indra/llvfs | |
parent | 07dd6cf67e316797974d1e26961d0d63a4b40ef2 (diff) | |
parent | 7a6b073dcafc55838f9f1f82bd5f940052ec7690 (diff) |
merge changes for DRTVWR-244
Diffstat (limited to 'indra/llvfs')
-rw-r--r-- | indra/llvfs/llvfs_objc.mm | 23 | ||||
-rw-r--r-- | indra/llvfs/tests/lldir_test.cpp | 2 |
2 files changed, 21 insertions, 4 deletions
diff --git a/indra/llvfs/llvfs_objc.mm b/indra/llvfs/llvfs_objc.mm index 16cfefda26..4f9e2f81e9 100644 --- a/indra/llvfs/llvfs_objc.mm +++ b/indra/llvfs/llvfs_objc.mm @@ -32,16 +32,22 @@ std::string* getSystemTempFolder() { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString * tempDir = NSTemporaryDirectory(); if (tempDir == nil) tempDir = @"/tmp"; - return ( new std::string([tempDir UTF8String]) ); + std::string *result = ( new std::string([tempDir UTF8String]) ); + [pool release]; + + return result; } //findSystemDirectory scoped exclusively to this file. std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory, NSSearchPathDomainMask domainMask) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + std::string *result; NSString *path = nil; @@ -60,19 +66,30 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory, result = new std::string([path UTF8String]); } + [pool release]; return result; } std::string* getSystemExecutableFolder() { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSString *bundlePath = [[NSBundle mainBundle] executablePath]; - return (new std::string([bundlePath UTF8String])); + std::string *result = (new std::string([bundlePath UTF8String])); + [pool release]; + + return result; } std::string* getSystemResourceFolder() { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSString *bundlePath = [[NSBundle mainBundle] resourcePath]; - return (new std::string([bundlePath UTF8String])); + std::string *result = (new std::string([bundlePath UTF8String])); + [pool release]; + + return result; } std::string* getSystemCacheFolder() diff --git a/indra/llvfs/tests/lldir_test.cpp b/indra/llvfs/tests/lldir_test.cpp index 323f876c12..3cff622a4b 100644 --- a/indra/llvfs/tests/lldir_test.cpp +++ b/indra/llvfs/tests/lldir_test.cpp @@ -134,7 +134,7 @@ struct LLDir_Dummy: public LLDir return 0; } - virtual BOOL fileExists(const std::string& pathname) const + virtual bool fileExists(const std::string& pathname) const { // Record fileExists() calls so we can check whether caching is // working right. Certain LLDir calls should be able to make decisions |