[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some small issues..
From: |
Ludovic Marcotte |
Subject: |
Re: Some small issues.. |
Date: |
Fri, 19 Oct 2001 15:24:59 -0400 (EDT) |
> > ASSIGN(tv, textView);
> >
> > and it should be:
> >
> > tv = textView;
Hi Nicola,
Actually, the ASSIGN statement is right. I didn't see the
RELEASE(textView); right after [scrollView setDocumentView: textView];
You can do:
...
ASSIGN(tv, textView);
[scrollView setDocumentView: textView];
RELEASE(textView)
or simply (I prefer that):
tv = textView;
[scrollView setDocumentView: textView];
There's also an other memory leak in Ink.app. In -makeWindowControllers
we do:
NSWindowController *controller;
NSWindow *win = [self makeWindow];
controller = [[NSWindowController alloc] initWithWindow: win];
...
but it should be:
NSWindowController *controller;
NSWindow *win = [self makeWindow];
controller = [[NSWindowController alloc] initWithWindow: win];
RELEASE(win);
...
Otherwise, win will always have a retainCount of >= 1 and will never
release the textView and the scrollView that it is retaining.
Ludo
--
Live as if you were to die tomorrow.
Learn as if you were to live forever.
- Gandhi