Interesting, OK, now remember, t this is new to me.

To begin the QL panel I run this required method:
- (void)beginPreviewPanelControl:(QLPreviewPanel *)panel
{    
    previewPanel = [panel retain];
    panel.delegate = self;
    panel.dataSource = self;
}
 
and then it ends with 

- (void)endPreviewPanelControl:(QLPreviewPanel *)panel
{
    [previewPanel release];
    previewPanel = nil;
}

Where QLPreviewPanel* previewPanel; is defined in my header file.

The crash happens after the begin and never gets to the end.  

I see here 
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcCoreFoundation.html
 that to "ensure the longevity of Objective-C objects, you should use CFRetain 
instead of retain".  

I haven't been able to find the correct syntax to replace the retain/release 
with CFRetain/CFRelease

On May 3, 2011, at 7:51 PM, Wim Lewis wrote:

> 
> On 3 May 2011, at 4:03 PM, Brad Stone wrote:
>> I have a symbolic breakpoint set and it stops on 
>> auto_refcount_underflow_error, even the small files.  If I continue the doc 
>> shows in QL.
> 
> Presumably, a few stack frames up, there will be a call to CFRelease() which 
> is causing the underflow (what would be an over-released zombie in a non-GC 
> app).
> 
> The first thing I'd look for is using CFRelease() when you should call 
> -release (or vise versa, and the same for retain): code written pre-GC would 
> treat those as equivalent, but in a GC or optional-GC world they need to be 
> treated as operating on distinct kinds of refcount.
> 
> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to