GC and print operations cause objects not to finalize?
GC and print operations cause objects not to finalize?
- Subject: GC and print operations cause objects not to finalize?
- From: Ashley Clark <email@hidden>
- Date: Thu, 20 Nov 2008 17:13:11 -0600
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