Re: [Q] Releasing objects owned by Gorm interface element

Samuel Hornus <[email protected]>
Newsgroups gmane.comp.lib.gnustep.user
Organization ARTIS/GRAVIR
Message-ID <[email protected]>
Gregory wrote:
> It is the responsibility of the app to release certain top level
> objects contain in the nib (in this place, gorm) file.
> 
> Here is a good place to start: 
>http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResou
>rces/Concepts/NibFileLoaded.html

> You need to maintain a connection to any windows, menus, controllers
> or other toplevel objects you have created.   Generally, these are the
> objects you see in  IB/Gorm in the "Objects View".
> 
> Please make sure you are correctly deallocating these.

Hi Gregory,
Thank your for the link.
I discovered the - (BOOL)applicationShouldTerminate:(id)sender
that can be implemented into the NSApp's delegate.

In this method, I am able to release my custom view. This works.

My interface has one button, one custom view, the main menu; I guess I
don't have to release the main Menu and the button manually, am I right
?

Then, the only object left is the NSApp's delegate itself. It is
instanciated it Gorm and set as the App's delegate in Gorm as well. How
can I properly release this delegate ?

For the moment, I implemented this as follows...
is that correct ?

// Application's delegate implementation :

// The Log can be seen when I quit the App, cool :-)
- (void)dealloc
{
    NSLog(@"Fairing Manager is deallocating...");
    [view release]; // view is my Custom NVOpenGLView
    [super dealloc];
}

- (NSApplicationTerminateReply)applicationShouldTerminate:(id)sender
{
    [self release];
    return NSTerminateNow;
}

regards,
-- 
Samuel Hornus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.