diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-01-23 09:59:45 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-01-23 09:59:45 +0000 |
| commit | f80d9c6d49eaf08d65420a3a5b47db5165add724 (patch) | |
| tree | 036032a5a62089aab4a116571fb9be10925a32f2 | |
| parent | fa9f4f452264469797645eb2d41d6de15b26a71d (diff) | |
| download | puzzles-f80d9c6d49eaf08d65420a3a5b47db5165add724.zip puzzles-f80d9c6d49eaf08d65420a3a5b47db5165add724.tar.gz puzzles-f80d9c6d49eaf08d65420a3a5b47db5165add724.tar.bz2 puzzles-f80d9c6d49eaf08d65420a3a5b47db5165add724.tar.xz | |
Ah, no, _that_ fixes the malloc problem. I'd forgotten that midend.c
already takes care of managing the allocation of game presets, so
there's no need for me to introduce scary ObjC machinery to do so in
the frontend.
[originally from svn r5178]
| -rw-r--r-- | macosx.m | 22 |
1 files changed, 0 insertions, 22 deletions
@@ -120,40 +120,19 @@ NSMenu *typemenu; @interface DataMenuItem : NSMenuItem { void *payload; - int payload_free; } - (void)setPayload:(void *)d; -- (void)setPayloadFree:(BOOL)yesno; - (void *)getPayload; @end @implementation DataMenuItem -- (id)initWithTitle:(NSString *)title - action:(SEL)act - keyEquivalent:(NSString *)key -{ - id ret = [super initWithTitle:title action:act keyEquivalent:key]; - payload = NULL; - payload_free = NO; - return ret; -} - (void)setPayload:(void *)d { payload = d; } -- (void)setPayloadFree:(BOOL)yesno -{ - payload_free = yesno; -} - (void *)getPayload { return payload; } -- (void)dealloc -{ - if (payload_free) - sfree(payload); - [super dealloc]; -} @end /* ---------------------------------------------------------------------- @@ -489,7 +468,6 @@ struct frontend { [item setTarget:self]; [item setAction:@selector(presetGame:)]; [item setPayload:params]; - [item setPayloadFree:YES]; [typemenu insertItem:item atIndex:0]; } |