bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some small issues..


From: Nicola Pero
Subject: Re: Some small issues..
Date: Mon, 22 Oct 2001 16:50:57 +0100 (BST)

Thanks - applied

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]