2 Copyright © 2002-2007, The AROS Development Team. All rights reserved.
8 #include <proto/muimaster.h>
9 #include <proto/intuition.h>
10 #include <proto/exec.h>
12 #include "muimaster_intern.h"
13 #include "support_classes.h"
16 /*****************************************************************************
19 AROS_LH1(VOID
, MUI_FreeClass
,
22 AROS_LHA(Class
*, cl
, A0
),
25 struct Library
*, MUIMasterBase
, 14, MUIMaster
)
28 Frees a class returned by MUI_GetClass().
31 cl - The pointer to the class.
34 VOID - The function always succeed: if the class can't be
37 This function is obsolete, DO NOT use it.
44 MUI_GetClass(), MUI_CreateCustomClass(), MUI_DeleteCustomClass()
50 *****************************************************************************/
54 ObtainSemaphore(&MUIMB(MUIMasterBase
)->ZuneSemaphore
);
56 /* CLF_INLIST tells us that this class is a builtin class */
57 if (cl
->cl_Flags
& CLF_INLIST
)
59 Class
*super
= cl
->cl_Super
;
61 if (--cl
->cl_Dispatcher
.h_Data
== 0)
63 ZUNE_RemoveBuiltinClass(cl
, MUIMasterBase
);
67 CloseLibrary(MUIMasterBase
);
68 if (strcmp(super
->cl_ID
, ROOTCLASS
) != 0)
73 /* Re-add the class to the list since freeing it failed */
74 ZUNE_AddBuiltinClass(cl
, MUIMasterBase
);
76 /* And also increase the reference counter again */
77 cl
->cl_Dispatcher
.h_Data
++;
81 ReleaseSemaphore(&MUIMB(MUIMasterBase
)->ZuneSemaphore
);
85 ReleaseSemaphore(&MUIMB(MUIMasterBase
)->ZuneSemaphore
);
87 CloseLibrary((struct Library
*)cl
->cl_Dispatcher
.h_Data
);
92 } /* MUIA_FreeClass */