Memory Leak?
Memory Leak?
- Subject: Memory Leak?
- From: Richard Kendall Wolf <email@hidden>
- Date: Wed, 12 Jun 2002 14:06:23 -0500
Hi guys,
I have spent some serious time trying to discover the answer to this
question, but I'm stumped. If this is a really stupid question, please
feel free to flame me (I can take it) and name the source of the
answer ... I would be most grateful.
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.
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
_______________________________________________
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.