On Dec 7, 2011, at 4:57 AM, Ken Thomases wrote:
> On Dec 6, 2011, at 8:01 PM, Steve Sisak wrote:
>> Given that operations have much shorter lifespan than threads, I'd worry
>> about the leaked NSAutoreleasePool objects in a long-running application.
>
> When using Cocoa, exceptions should be, wel
On Dec 6, 2011, at 6:01 PM, Steve Sisak wrote:
> I realize that this is moot in the case of @autorelease, but in the context
> of "best practices" for code that can't depend on ARC
@autoreleasepool does not require ARC.
--
Greg Parker gpar...@apple.com Runtime Wrangler
__
On Dec 6, 2011, at 8:01 PM, Steve Sisak wrote:
> Given that operations have much shorter lifespan than threads, I'd worry
> about the leaked NSAutoreleasePool objects in a long-running application.
When using Cocoa, exceptions should be, well, exceptional. They should not be
used for flow cont
At 3:59 PM -0600 12/6/11, Ken Thomases wrote:
The workaround is necessary because the exception object raised in
allocAndRaise() has been autoreleased. It is no longer owned by
anything and is only still around because the pool containing the
pending release(s) has not been drained. When you
On Dec 6, 2011, at 4:59 PM, Ken Thomases wrote:
> On Dec 6, 2011, at 2:47 PM, Larry Campbell wrote:
>
>> void allocAndRaise()
>> {
>> [[[NSString alloc] initWithString:@"foo bar and zot"] autorelease];
>> [NSException raise:@"foo" format:@"bar"];
>> }
>>
>> //#define LEAK
>>
>> void foo()
>
On Dec 6, 2011, at 4:02 PM, Greg Parker wrote:
> On Dec 6, 2011, at 12:47 PM, Larry Campbell wrote:
>> (Mac OS X 10.6.8, Xcode 4.0.2, no GC)
>>
>> I believe the following paragraph in the "Using Autorelease Pools" section
>> of the "Memory Management Programming Guide" is wrong, or misleading:
>
On Dec 6, 2011, at 2:47 PM, Larry Campbell wrote:
> void allocAndRaise()
> {
>[[[NSString alloc] initWithString:@"foo bar and zot"] autorelease];
>[NSException raise:@"foo" format:@"bar"];
> }
>
> //#define LEAK
>
> void foo()
> {
>NSAutoreleasePool *pool = [NSAutoreleasePool new];
>
On Dec 6, 2011, at 12:47 PM, Larry Campbell wrote:
> (Mac OS X 10.6.8, Xcode 4.0.2, no GC)
>
> I believe the following paragraph in the "Using Autorelease Pools" section of
> the "Memory Management Programming Guide" is wrong, or misleading:
>
> "This behavior has implications for exceptional co
(Mac OS X 10.6.8, Xcode 4.0.2, no GC)
I believe the following paragraph in the "Using Autorelease Pools" section of
the "Memory Management Programming Guide" is wrong, or misleading:
"This behavior has implications for exceptional conditions. If an exception
occurs, and the thread suddenly tran