childs -> children.
[AROS.git] / workbench / libs / icon / freediskobject.c
blobd6646056e1737e735c0586f8f7825b59fefcf9dd
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <proto/arossupport.h>
9 #include "icon_intern.h"
10 #include <stddef.h>
12 extern const IPTR IconDesc[];
14 /*****************************************************************************
16 NAME */
17 #include <clib/icon_protos.h>
19 AROS_LH1(void, FreeDiskObject,
21 /* SYNOPSIS */
22 AROS_LHA(struct DiskObject *, diskobj, A0),
24 /* LOCATION */
25 struct IconBase *, IconBase, 15, Icon)
27 /* FUNCTION
28 Frees all memory for a DiskObject structure.
30 INPUTS
31 diskobj -- a pointer to a DiskObject structure. A NULL pointer will be
32 ignored.
34 RESULT
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 GetDiskObject()
45 INTERNALS
47 HISTORY
48 2006-04-09 Test for NULL pointer added
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
54 if ( ! diskobj) return;
56 struct NativeIcon *nativeicon;
58 nativeicon = NATIVEICON(diskobj);
60 /* Remove all layout specific data
61 * (ie displayable bitmaps, pen allocations, etc)
63 LayoutIconA(diskobj, NULL, NULL);
65 RemoveIconFromList(nativeicon, LB(IconBase));
67 /* It's enough to free our FreeList */
68 FreeFreeList(&nativeicon->ni_FreeList);
70 AROS_LIBFUNC_EXIT
72 } /* FreeDiskObject */