diff --git a/TODO.md b/TODO.md index 7829b1d3..916a8742 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,5 @@ +- go through ALL the objective-c objects we create and make sure we are using the proper ownership (alloc/init and new are owned by us, all class method constructors are autoreleased - thanks mikeash) + - on OS X, edit shortcuts like command-C working require that the menu entries be defined, or so it seems, even for NSAlert - other platforms? diff --git a/darwin/map.m b/darwin/map.m index a66d0cd2..9fa2de96 100644 --- a/darwin/map.m +++ b/darwin/map.m @@ -13,10 +13,9 @@ struct mapTable *newMap(void) struct mapTable *m; m = uiNew(struct mapTable); - m->m = [NSMapTable mapTableWithKeyOptions:(NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality) - valueOptions:(NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality)]; - // TODO why do I need this - [m->m retain]; + m->m = [[NSMapTable alloc] initWithKeyOptions:(NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality) + valueOptions:(NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality) + capacity:0]; return m; }