My sheet leaks

  • 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
  • > 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.

    This is a known issue in Leopard, one which we hope to fix in an
    future update. There’s no way to prevent the leak on your own, so you
    can just ignore this one for now.

    -Ben
  • Thanks for the reply Ben.

    Best wishes

    John Maisey
    www.nhoj.co.uk

    On 25 Jan 2008, at 18:43, Benjamin Stiglitz wrote:

    >> 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.
    >
    > This is a known issue in Leopard, one which we hope to fix in an
    > future update. There’s no way to prevent the leak on your own, so
    > you can just ignore this one for now.
    >
    > -Ben
  • On Jan 25, 2008, at 1:20 PM, John M wrote:

    > Thanks for the reply Ben.
    >
    > Best wishes
    >
    > John Maisey
    > www.nhoj.co.uk
    >
    >
    >
    > On 25 Jan 2008, at 18:43, Benjamin Stiglitz wrote:
    >
    >>> 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.
    >>
    >> This is a known issue in Leopard, one which we hope to fix in an
    >> future update. There’s no way to prevent the leak on your own, so
    >> you can just ignore this one for now.
    >>
    >> -Ben
    >

    I just updated to 10.5.2 and the sheet leaking bug appears to be
    fixed.  Can anyone confirm?

    Thanks,

    Adhamh
  • > I just updated to 10.5.2 and the sheet leaking bug appears to be
    > fixed.  Can anyone confirm?

    Yes, it was fixed in 10.5.2.

    -Ben
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today