@@ -145,11 +145,11 @@ return 0; } @implementation OFApplication @synthesize programName = _programName, arguments = _arguments; -@synthesize environment = _environment; +@synthesize environment = _environment, activeSandbox = _activeSandbox; + (OFApplication *)sharedApplication { return app; } @@ -570,16 +570,21 @@ { # ifdef OF_HAVE_PLEDGE void *pool = objc_autoreleasePoolPush(); const char *promises = [[sandbox pledgeString] cStringWithEncoding: [OFLocalization encoding]]; + OFSandbox *oldSandbox; if (pledge(promises, NULL) != 0) @throw [OFSandboxActivationFailedException exceptionWithSandbox: sandbox errNo: errno]; objc_autoreleasePoolPop(pool); + + oldSandbox = _activeSandbox; + _activeSandbox = [sandbox retain]; + [oldSandbox release]; # endif } #endif @end