all,

I wanted to follow up my email from last week with some additional questions about the leaks instrument and what it is or isn't trying to tell me. When running the leaks instrument with NSZombieEnabled several lines of the following code are flagged as leaked memory...

    NSString            *filename;
    NSString            *keyString;
    NSString            *descriptionFilename;
    NSString            *description;
    NSDictionary        *descriptionDictionary;
    NSData              *descriptionData;
    NSFileHandle        *descriptionFile;
    const char          *buffer;

    filename = [path stringByAppendingPathComponent:file];
    buffer = [filename cStringUsingEncoding:NSUTF8StringEncoding];
keyString = [[filename lastPathComponent] stringByDeletingPathExtension]; descriptionFilename = [keyString stringByAppendingPathExtension:@"desc"]; descriptionFile = [NSFileHandle fileHandleForReadingAtPath:[path stringByAppendingPathComponent:descriptionFilename]];
    if(descriptionFile != nil) {
        descriptionData = [descriptionFile readDataToEndOfFile];
description = [[NSString alloc] initWithData:descriptionData encoding:NSUTF8StringEncoding]; descriptionDictionary = [description propertyListFromStringsFileFormat];
        [descriptionFile closeFile];
        [description release];
    }

Nearly every NSString* as well as the NSDictionary*, NSData* and NSFileHandle* are flagged as memory leaks despite the fact that the only object created with alloc, new or something with 'copy' in it is the NSString* description, which I do release. Note that leaks identifies it as a leak as well. Am I misinterpreting the leaks output or am I still missing something fundamental?

tia,

Bob
_______________________________________________

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