help-gnustep
[Top][All Lists]
Advanced

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

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


From: Gregory John Casamento
Subject: Re: [Q] Releasing objects owned by Gorm interface element
Date: Wed, 8 Dec 2004 17:09:10 -0800 (PST)

Sam,

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/LoadingResources/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.

GJC

--- Samuel Hornus <prenomdotnomdotinriadotfr@nospam.com> wrote:

> 
> Hi,
> 
> I have a MeshView subclass of NSOpenGLView, which is instanciated
> via a Gorm interface.
> 
> The MeshView owns a Mesh like this:
> 
> - (void)setMesh:(Mesh *)aMesh;
> {
>     [mMesh autorelease];
>     [aMesh retain];
>     mMesh = aMesh;
> }
> 
> and releases the Mesh at the end like this:
> 
> - (void)dealloc
> {
>     [mMesh release];
> }
> 
> When the app is running, I have checked that the retainCount of
> mMesh is correctly equal to one.
> 
> When I quit the application, however the Mesh does not seem to be released:
> as I wrote:
> 
> // Mesh implementation...
> 
> - (void)dealloc
> {
>     NSLog(@"Deallocating mesh...\n");
>     fprintf(stderr,"Deallocating mesh stderr...\n");
>     if( NULL != mVertices )
>         free(mVertices);
>     if( NULL != mIndices )
>         free(mIndices);
>     [super dealloc];
> }
> 
> And nothing gets written on my terminal...
> 
> Is dealloc: ever called ?
> How can I make sure the Mesh is deallocated ?
> TIA !
> -- 
> Samuel Hornus
> _______________________________________________
> Help-gnustep mailing list
> Help-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnustep
> 


=====
Gregory John Casamento 
-- CEO/President Open Logic Corp. (A Maryland Corporation)
#### Maintainer of Gorm for GNUstep.




reply via email to

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