chiark / gitweb /
Ah, no, _that_ fixes the malloc problem. I'd forgotten that midend.c
authorSimon Tatham <anakin@pobox.com>
Sun, 23 Jan 2005 09:59:45 +0000 (09:59 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 23 Jan 2005 09:59:45 +0000 (09:59 +0000)
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]

macosx.m

index 9b59ea2eac5b1940cb4efbeee415d6319dfd9a65..52a70ef6457844eca765f90103c5d96ba8e95cb6 100644 (file)
--- a/macosx.m
+++ b/macosx.m
@@ -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];
        }