2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
8 #include <proto/arossupport.h>
9 #include "icon_intern.h"
12 extern const IPTR IconDesc
[];
14 /*****************************************************************************
17 #include <clib/icon_protos.h>
19 AROS_LH1(void, FreeDiskObject
,
22 AROS_LHA(struct DiskObject
*, diskobj
, A0
),
25 struct IconBase
*, IconBase
, 15, Icon
)
28 Frees all memory for a DiskObject structure.
31 diskobj -- a pointer to a DiskObject structure. A NULL pointer will be
48 2006-04-09 Test for NULL pointer added
50 *****************************************************************************/
54 if ( ! diskobj
) return;
56 struct NativeIcon
*nativeicon
;
58 nativeicon
= NATIVEICON(diskobj
);
60 /* Remove all layout specific data
61 * (i.e. displayable bitmaps, pen allocations, etc.)
63 LayoutIconA(diskobj
, NULL
, NULL
);
65 RemoveIconFromList(nativeicon
, LB(IconBase
));
67 /* It's enough to free our FreeList and the top-level structure */
68 FreeFreeList(&nativeicon
->ni_FreeList
);
69 FreeMem(nativeicon
, sizeof(struct NativeIcon
));
73 } /* FreeDiskObject */