Implemented uninitMenus() on Mac OS X.
This commit is contained in:
parent
2ec8fb8589
commit
f47c8172e1
|
@ -65,7 +65,7 @@ const char *uiInit(uiInitOptions *o)
|
|||
|
||||
void uiUninit(void)
|
||||
{
|
||||
// TODO free menus
|
||||
uninitMenus();
|
||||
// TODO free application delegate
|
||||
uninitAlloc();
|
||||
}
|
||||
|
|
|
@ -347,3 +347,27 @@ void finalizeMenus(void)
|
|||
{
|
||||
menusFinalized = YES;
|
||||
}
|
||||
|
||||
void uninitMenus(void)
|
||||
{
|
||||
if (menus == NULL)
|
||||
return;
|
||||
[menus enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop) {
|
||||
NSValue *v;
|
||||
struct menu *m;
|
||||
|
||||
v = (NSValue *) obj;
|
||||
m = (struct menu *) [v pointerValue];
|
||||
[m->items enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop) {
|
||||
NSValue *v;
|
||||
struct menuItem *mi;
|
||||
|
||||
v = (NSValue *) obj;
|
||||
mi = (struct menuItem *) [v pointerValue];
|
||||
uiFree(mi);
|
||||
}];
|
||||
[m->items release];
|
||||
uiFree(m);
|
||||
}];
|
||||
[menus release];
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
- (NSMenu *)makeMenubar;
|
||||
@end
|
||||
extern void finalizeMenus(void);
|
||||
extern void uninitMenus(void);
|
||||
|
||||
// init.m
|
||||
@interface appDelegate : NSObject <NSApplicationDelegate>
|
||||
|
|
Loading…
Reference in New Issue