Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / boopsi / disposeobject.c
blob2d8784641b9ff735d81e40a9827e69fe6b81ae2f
1 /*
2 Copyright © 1995-2001, 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 NewObject(), SetAttrs((), 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 AROS_LIBBASE_EXT_DECL(struct Library *,BOOPSIBase)
68 ULONG MethodID = OM_DISPOSE;
70 if (!object)
71 return;
73 OCLASS (object)->cl_ObjectCount --;
75 DoMethodA (object, (Msg)&MethodID);
77 AROS_LIBFUNC_EXIT
78 } /* DisposeObject */