Updated Sourceforge username and host.
[tangerine.git] / rom / boopsi / disposeobject.c
blobb2fb15bb1821bb554b464fac7d4969e2e6e3354d
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Dispose of a BOOPSI Object.
6 Lang: english
7 */
8 #include <intuition/classes.h>
9 #include <proto/alib.h>
10 #include <clib/intuition_protos.h>
11 #include "intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <intuition/classusr.h>
17 #include <proto/boopsi.h>
19 AROS_LH1(void, DisposeObject,
21 /* SYNOPSIS */
22 AROS_LHA(APTR, object, A0),
24 /* LOCATION */
25 struct Library *, BOOPSIBase, 6, BOOPSI)
27 /* FUNCTION
28 Deletes a BOOPSI object. All memory associated with the object
29 is freed. The object must have been created with NewObject().
30 Some object contain other object which might be freed as well
31 when this function is used on the "parent" while others might
32 also contain children but won't free them. Read the documentation
33 of the class carefully to find out how it behaves.
35 INPUTS
36 object - The result of a call to NewObject() or a similar function,
37 may be NULL.
39 RESULT
40 None.
42 NOTES
43 This functions sends OM_DISPOSE to the object.
45 Be careful not to use this function inside of OM_NEW to dispose
46 the current object. This can cause massive problems. Use
47 CoerceMethod() on the current class and object instead.
49 EXAMPLE
51 BUGS
53 SEE ALSO
54 NewObjectA(), SetAttrsA(), GetAttr(), MakeClass()
55 "Basic Object-Oriented Programming System for Intuition" and
56 "boopsi Class Reference" Dokument.
58 INTERNALS
60 HISTORY
61 29-10-95 digulla automatically created from
62 intuition_lib.fd and clib/intuition_protos.h
64 *****************************************************************************/
66 AROS_LIBFUNC_INIT
67 ULONG MethodID = OM_DISPOSE;
69 if (!object)
70 return;
72 OCLASS (object)->cl_ObjectCount --;
74 DoMethodA (object, (Msg)&MethodID);
76 AROS_LIBFUNC_EXIT
77 } /* DisposeObject */