Re: cocoa context and autorelease pools
Re: cocoa context and autorelease pools
- Subject: Re: cocoa context and autorelease pools
- From: "Clark Cox" <email@hidden>
- Date: Mon, 17 Dec 2007 06:39:35 -0800
don't bother detecting if one already exists; just create one unconditionally.
On 12/17/07, Wesley Smith <email@hidden> wrote:
> So what is the procedure for detecting if one exists and creating one
> if none is detected?
> thanks,
> wes
>
> On Dec 17, 2007 1:12 AM, Dominik Pich <email@hidden> wrote:
> > You always need an autoreoease pool. One per thread atleast.
> > Because even if you release everything cocoa needs one internally
> >
> > Regards,
> > Dominik
> >
> > Am Dec 17, 2007 um 9:24 AM schrieb Wesley Smith:
> >
> >
> > > Hi,
> > > I'm working on a Lua module for constructing Cocoa windows and am
> > > curious about a few points regarding when and where one can use Cocoa
> > > classes. If I run the module from the command line and load the
> > > plugin and test script which attempts to build an NSWindow, I get the
> > > following errors at runtime:
> > >
> > > 2007-12-17 00:16:09.893 lua[1465] *** _NSAutoreleaseNoPool(): Object
> > > 0x3204e0 of class NSMutableParagraphStyle autoreleased with no pool in
> > > place - just leaking
> > > 2007-12-17 00:16:09.893 lua[1465] *** _NSAutoreleaseNoPool(): Object
> > > 0x31f570 of class NSCFDictionary autoreleased with no pool in place -
> > > just leaking
> > > 2007-12-17 00:16:09.893 lua[1465] *** _NSAutoreleaseNoPool(): Object
> > > 0x321f90 of class NSCFString autoreleased with no pool in place - just
> > > leaking
> > > 2007-12-17 00:16:09.894 lua[1465] *** _NSAutoreleaseNoPool(): Object
> > > 0x321ef0 of class NSException autoreleased with no pool in place -
> > > just leaking
> > > 2007-12-17 00:16:09.894 lua[1465] *** Uncaught exception:
> > > <NSInternalInconsistencyException> Error (1002) creating CGSWindow
> > >
> > > Do I have to run this thing within an NSApplication? Are there other
> > > contexts within which Cocoa can be used? I'm not quite sure what's
> > > going on so any info or pointers to relevant docs is appreciated.
> > >
> > > thanks,
> > > wes
> > > _______________________________________________
> > >
> > > 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
>
--
Clark S. Cox III
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