Re: GC and print operations cause objects not to finalize?
Re: GC and print operations cause objects not to finalize?
- Subject: Re: GC and print operations cause objects not to finalize?
- From: Ashley Clark <email@hidden>
- Date: Thu, 20 Nov 2008 17:38:53 -0600
Filed: rdar://6390443
I was kind of hoping it was something I was doing though. Any ideas
for a workaround?
Ashley
On Nov 20, 2008, at 5:21 PM, Bill Bumgarner wrote:
Please file a bug. It may also be that something is CFRetaining the
document that shouldn't be.
On Nov 20, 2008, at 5:13 PM, Ashley Clark wrote:
I've got a GC-only document-based application and I'm trying to add
basic print operations to my documents. I've reduced this down to
what I think is the absolute minimum required here and I'm still
seeing this bug.
With a completely new Document-based application I'm adding these 3
methods to my document class:
- (void)close {
NSLog(@"closing");
[super close];
}
- (void)finalize {
NSLog(@"finalizing");
[super finalize];
}
- (NSPrintOperation *)printOperationWithSettings:(NSDictionary
*)printSettings error:(NSError **)outError {
NSPrintInfo *printInfo = [self printInfo];
[printInfo setValuesForKeysWithDictionary:printSettings];
NSView *view = [[NSView alloc] initWithFrame:NSMakeRect(0, 0,
500, 500)];
return [NSPrintOperation printOperationWithView:view
printInfo:printInfo];
}
Now, if I run the program and open the print panel and cancel it a
few times in a row, usually 3 is enough and then close the
document. The document object itself will never finalize. And no
documents created or opened after that point will get finalized.
I've logged the document object address at creation time and once
I've seen that it has not been finalized I've paused the program
and tried info gc-roots and info gc-references on the document
object. gc-roots returns zero roots and gc-references returns
nothing at all.
What am I missing?
Ashley
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden