• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Programatically detect if any autorelease pool exists?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Programatically detect if any autorelease pool exists?


  • Subject: Programatically detect if any autorelease pool exists?
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 5 Sep 2006 15:38:02 -0400
  • Organization: Rogue Research

Hi all!

Is there a way to programatically detect if any autorelease pool exists?

Why?  I'm helping with a cross-platform open source library (vtk, if
you're curious) and I'm having a problem with autorelease pools.  The
library is C++ only (there are a few Obj-C++ classes, but that's an
internal implementation detail) and tends to be used in one of two ways:
in a cross-platform C++ app, or in a normal Cocoa application.

Currently, the library is creating its own NSAutoreleasePool then
releasing it later.  This works great in the first case (since cross
platform C++ apps should not be concerned with the fact that the
library's implementation needs an autorelease pool present) but is
problematic in the second case.

So what I'd like is for the library's code to be able to detect if no
autorelease pool exists, and only create one if that is the case.  I had
hoped that calling NSApplicationLoad() would create an autorelease pool,
but that doesn't seem to be the case.

Thanks for any help!

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Programatically detect if any autorelease pool exists?
      • From: Jonathon Mah <email@hidden>
    • Re: Programatically detect if any autorelease pool exists?
      • From: "Clark Cox" <email@hidden>
    • Re: Programatically detect if any autorelease pool exists?
      • From: John Stiles <email@hidden>
  • Prev by Date: Re: Tab and Enter in NSTextView
  • Next by Date: InterfaceBuilder programming info
  • Previous by thread: Re: Repeating Hotkeys
  • Next by thread: Re: Programatically detect if any autorelease pool exists?
  • Index(es):
    • Date
    • Thread