Re: Memory Leak in XIB file?
Re: Memory Leak in XIB file?
- Subject: Re: Memory Leak in XIB file?
- From: "Michael Ash" <email@hidden>
- Date: Sun, 5 Oct 2008 10:48:50 -0400
On Sun, Oct 5, 2008 at 1:26 AM, Jens Beuckenhauer <email@hidden> wrote:
> THE LEAK: It is a "GeneralBlock-48", of Event Type "Malloc" in
> "libTIFF.dylib". The responsible caller is "setByteArray". The library and
> "setByteArray" are not implemented by my self (so it must be Apple stuff).
> And as said: I can comment out all possible things of my code with /* xxx */
> , so that my application has nearly no function and the leak is there. I can
> delete every object in IB except for the ImageView and the leak is also
> there.
> But: If I simply delete the ImageView the leak is gone. Adding another
> ImageView also works leak free. But in the moment I set the image to
> "mainimage.tiff" via the inspector panel, the leak is back.
>
> And: I checked with a fresh projekt only having an ImageView with an image.
> Surely there is NO leak... So it must be something with my project.
Well, it would seem that libTIFF has a leak, and the reason you only
see it when you set an image is because you aren't calling into
libTIFF until you do so. (Or rather, Cocoa isn't calling into it.)
The big question is this: if you load your nib multiple times, do you
get multiple leaks?
This is important because one-time leaks aren't all that serious.
Leaks are really only a problem when they grow without bound. As such,
while the frameworks can *generally* be counted upon to not have
runaway leaks, it's not uncommon to have one-time leaks related to
their initialization code. For this reason I only pay attention to
leaks in frameworks if I can get them to increase by doing more of
whatever provokes them.
Mike
_______________________________________________
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