Re: Memory Leak?
Re: Memory Leak?
- Subject: Re: Memory Leak?
- From: Matt Neuburg <email@hidden>
- Date: Fri, 14 Jun 2002 11:28:23 -0700
On Wed, 12 Jun 2002 14:06:23 -0500, Richard Kendall Wolf <email@hidden>
said:
>
I invite you to create a simple, single window, Cocoa application. The
>
window should only contain a single-column NSTableView. Implement as
>
simple controller a la the code I've provided below. Compile and run.
>
Fire up top on the command-line, then click on a row in the application
>
and drag up-and-down rows for a while. Just keep dragging up and down
>
for a while. As you do, you'll watch the RPVT memory value go up, and
>
up, and up. When you stop dragging, it does -not- go back down ... it
>
simply keeps the value that it had when you stopped dragging. Then,
>
start dragging again ... RPVT will begin going up, and up, and up.
Fascinating, Captain. If you look at this with ObjectAlloc, what's leaking
appears to be the redrawing of the "thumb" in the scrollbar. m.
>
Is this a bona-fide memory leak in Cocoa ... or am I missing something?
>
>
----- HEADER FILE -----
>
>
>
/* TableController */
>
>
#import <Cocoa/Cocoa.h>
>
>
@interface TableController : NSObject
>
{
>
IBOutlet NSTableView *tableView;
>
}
>
>
- ( int ) numberOfRowsInTableView: ( NSTableView * ) tv;
>
- ( id ) tableView: ( NSTableView * ) tv
>
objectValueForTableColumn: ( NSTableColumn * ) c
>
row: ( int ) r;
>
>
@end
>
>
>
----- IMPLEMENTATION FILE -----
>
>
>
#import "TableController.h"
>
>
@implementation TableController
>
>
- ( int ) numberOfRowsInTableView: ( NSTableView * ) tv
>
{
>
return 10;
>
}
>
>
- ( id ) tableView: ( NSTableView * ) tv
>
objectValueForTableColumn: ( NSTableColumn * ) c
>
row: ( int ) r
>
{
>
return @"Test";
>
}
>
>
@end
>
>
--__--__--
>
>
Message: 9
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.