2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: ReleaseNamedObject()
8 #include <proto/exec.h>
11 /*****************************************************************************
14 #include <proto/utility.h>
16 AROS_LH1(void, ReleaseNamedObject
,
19 AROS_LHA(struct NamedObject
*, object
, A0
),
22 struct UtilityBase
*, UtilityBase
, 43, Utility
)
25 Releases a NamedObject that you previously obtained by calling
29 object - The NamedObject to release.
32 The NamedObject will be released from your possession, and if it
33 is ready to be deallocated, then the NamedObject will be freed.
36 WARNING: You really should actually have found the NamedObject
37 first (that is with FindNamedObject()) before calling this
38 function. Failure to take heed of this will cause memory
42 struct NamedObject *nObj, *myNameSpace;
44 if( nObj = FindNamedObject( myNameSpace, "Some Name", NULL ) )
47 Here you do whatever you want. However The NamedObject
48 structure should generally be treated READ-ONLY
51 ReleaseNamedObject( nObj );
57 utility/name.h, FindNamedObject()
62 29-10-95 digulla automatically created from
63 utility_lib.fd and clib/utility_protos.h
64 11-08-96 iaint Adapted for AROS 1.5+.
65 18-10-96 iaint Changed for different format NamedObjects.
67 *****************************************************************************/
71 struct IntNamedObject
*no
;
76 no
= GetIntNamedObject( object
);
78 /* if(no more users) */
79 if( --no
->no_UseCount
== 0 )
81 if( no
->no_FreeMessage
) RemNamedObject( object
, NULL
);
88 } /* ReleaseNamedObject */