| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Well it's more likely to be a CFCopyLocalizedString type thing.Why isn't that a memory leak?Well it's not a memory leak if you don't own those strings.
It could, potentially, be a memory leak, but there's no way for you to
know.
I strongly suspect, however, that it is not.
At the very least, the operating system is probably expecting to use
the same strings every time you create default dialog options. If you
were to free those strings out from under the Navigation Services
framework, that would be a Bad Thing
If I had to guess at how Navigation services is implemented, however, I
would say that you couldn't really "free" those strings even if you
tried. The operating system is probably creating a CFString from a
static string somewhere using the same technology that sits behind the
CFSTR macro. With such objects you can pretty much think of the string
as being created at compile-time and stored in the program's global
data.
As I understand, these strings can actually participate inI seem to recall that conceptually CFSTR(foo) actually calls through to cfstringcreatewithcstring (cacheing results of course), although that is of course an implementation detail that may have changed, i note that gcc has an fconstant-cfstrings switch. Whatever they are, they do behave as you would expect any cftype to: releaseing them more times than you have retained/copied/created them is definitely bad mojo.
retain-release semantics. Since the memory can't actually be freed,
however, releasing them enough that they should be freed is actually
an unsupported operation with undefined behavior (at least according to
engineers at Apple).
The thing to keep in mind here, however, is that you didn't allocate_______________________________________________
those strings so you are not responsible for releasing them. If it is
a memory leak... it's the OSes fault and not yours.
--
Macintosh Software Engineering Consulting Services
Visit my resume at <http://homepage.mac.com/easco/RSTResume.html>
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.
| References: | |
| >Re: how to set NavDialogCreationOptions strings (From: Kurt Bigler <email@hidden>) | |
| >Re: how to set NavDialogCreationOptions strings (From: Frederick Cheung <email@hidden>) | |
| >Re: how to set NavDialogCreationOptions strings (From: Scott Thompson <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.