Leaks with savepanel
Leaks with savepanel
- Subject: Leaks with savepanel
- From: "Mr. Gecko" <email@hidden>
- Date: Tue, 18 Mar 2008 17:49:05 -0500
I don't see where the leak is but there is a leak in this code.
mainWindow.h
#import <Cocoa/Cocoa.h>
@interface mainWindow : NSObject {
}
- (IBAction)button:(id)sender;
@end
mainWindow.m
#import "mainWindow.h"
@implementation mainWindow
- (IBAction)button:(id)sender {
NSSavePanel *panel = [NSSavePanel savePanel];
[panel setTitle:NSLocalizedString(@"save", @"save panel")];
[panel setPrompt:NSLocalizedString(@"save", @"save panel")];
[panel setTreatsFilePackagesAsDirectories:NO];
[panel setRequiredFileType:@"rtf"];
[panel runModal];
}
@end
Here is the out put of Instruments
Self% Self Size Address Leaked Object
30.7 64B 0x1aeab0 NSCFString
23 48B 0x1aeb10 GeneralBlock-48
15.3 32B 0x1adc20 NSCFString
15.3 32B 0x1adfb0 NSCFArray
15.3 32B 0x1aeb40 NSCFSting
Note that I am new to cocoa and instruments.
_______________________________________________
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