My sheet leaks
My sheet leaks
- Subject: My sheet leaks
- From: John Maisey <email@hidden>
- Date: Fri, 25 Jan 2008 17:53:55 +0000
Hello,
I am having problems with implementing a sheet under Leopard 10.5.1.
The panel is in the same nib as the main window. It is all connected
and everything appears to work fine. However when checking it leaks
when the sheet is opened.
Can someone tell me what the problem is, and what I need to do to fix
it? Thanks.
After opening the sheet I get multiple leaks that look like:
leaked object, GeneralBlock-64 :
0 CoreGraphics shape_alloc_bounds
1 CoreGraphics CGSNewRegionWithRect
2 CoreGraphics resizeTopShadow
3 CoreGraphics MetalSheetProgress
4 AppKit _NSMoveHelperTimerCallBack
5 CoreFoundation CFRunLoopRunSpecific
6 AppKit -[NSMoveHelper _doAnimation]
7 AppKit -[NSMoveHelper(NSSheets) _moveParent:andOpenSheet:]
8 AppKit -[NSWindow(NSSheets) _orderFrontRelativeToWindow:]
9 AppKit -[NSWindow
_reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
10 AppKit -[NSApplication _orderFrontModalWindow:relativeToWindow:]
11 AppKit -[NSApplication
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo
:]
12 AppKit -[NSApplication sendAction:to:from:]
13 AppKit -[NSControl sendAction:to:]
14 AppKit -[NSCell trackMouse:inRect:ofView:untilMouseUp:]
15 AppKit -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]
16 AppKit -[NSControl mouseDown:]
17 AppKit -[NSWindow sendEvent:]
18 AppKit -[NSApplication sendEvent:]
19 AppKit -[NSApplication run]
20 AppKit NSApplicationMain
21 test sheets start
22 0x1
leaked object, CGSRegion :
0 CoreFoundation _CFRuntimeCreateInstance
1 CoreGraphics CGTypeCreateInstanceWithAllocator
2 CoreGraphics CGSNewRegion
3 CoreGraphics CGSNewRegionWithRect
4 CoreGraphics resizeTopShadow
5 CoreGraphics MetalSheetProgress
6 AppKit _NSMoveHelperTimerCallBack
7 CoreFoundation CFRunLoopRunSpecific
8 AppKit -[NSMoveHelper _doAnimation]
9 AppKit -[NSMoveHelper(NSSheets) _moveParent:andOpenSheet:]
10 AppKit -[NSWindow(NSSheets) _orderFrontRelativeToWindow:]
11 AppKit -[NSWindow
_reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
12 AppKit -[NSApplication _orderFrontModalWindow:relativeToWindow:]
13 AppKit -[NSApplication
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo
:]
14 AppKit -[NSApplication sendAction:to:from:]
15 AppKit -[NSControl sendAction:to:]
16 AppKit -[NSCell trackMouse:inRect:ofView:untilMouseUp:]
17 AppKit -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]
18 AppKit -[NSControl mouseDown:]
19 AppKit -[NSWindow sendEvent:]
20 AppKit -[NSApplication sendEvent:]
21 AppKit -[NSApplication run]
22 AppKit NSApplicationMain
23 test sheets start
24 0x1
The controller looks like:
#import <Cocoa/Cocoa.h>
@interface SheetController : NSObject {
IBOutlet NSWindow *mainWindow;
IBOutlet NSWindow *sheetWindow;
}
- (IBAction)openSheet:(id)sender;
- (IBAction)closeSheet:(id)sender;
- (void)didEndSheet:(NSWindow *)sheet
returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
@end
@implementation SheetController
// Call to open sheet
- (IBAction)openSheet:(id)sender
{
[NSApp beginSheet:sheetWindow
modalForWindow:mainWindow
modalDelegate:self
didEndSelector:@selector(didEndSheet:returnCode:contextInfo:)
contextInfo:nil];
}
// Call this to close sheet
- (IBAction)closeSheet:(id)sender
{
[NSApp endSheet:sheetWindow];
}
// Called by openSheet
- (void)didEndSheet:(NSWindow *)sheet
returnCode:(int)returnCode
contextInfo:(void *)contextInfo
{
[sheet orderOut:self];
}
@end
Thank you
John Maisey
_______________________________________________
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