Differences From Artifact [84c38f0c0c]:
- File
src/OFDictionary.m
— part of check-in
[e9d48d0beb]
at
2009-05-01 18:15:32
on branch trunk
— Call [super free] on error in init methods.
Reason is that - free might free stuff which is allocated during the
initialization, which might not be allocated when an error occurred. (user: js, size: 3146) [annotate] [blame] [check-ins using]
To Artifact [e7cc2d1d1a]:
- File
src/OFDictionary.m
— part of check-in
[06ad922132]
at
2009-05-01 22:28:50
on branch trunk
— Work around a compiler bug that occurs on OS X.
It seems super has the wrong type (struct _objc_super*) inside a
@try block. (user: js, size: 3416) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
37 38 39 40 41 42 43 | size = 4096; @try { data = [self allocNItems: size withSize: sizeof(OFList*)]; } @catch (OFException *e) { | > > > > > | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | size = 4096; @try { data = [self allocNItems: size withSize: sizeof(OFList*)]; } @catch (OFException *e) { /* * We can't use [super free] on OS X here. Compiler bug? * Anyway, set size to 0 so that [self free] works. */ size = 0; [self free]; @throw e; } memset(data, 0, size); return self; } |
︙ | ︙ | |||
63 64 65 66 67 68 69 | size = (size_t)1 << hashsize; @try { data = [self allocNItems: size withSize: sizeof(OFList*)]; } @catch (OFException *e) { | > > > > > | | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | size = (size_t)1 << hashsize; @try { data = [self allocNItems: size withSize: sizeof(OFList*)]; } @catch (OFException *e) { /* * We can't use [super free] on OS X here. Compiler bug? * Anyway, set size to 0 so that [self free] works. */ size = 0; [self free]; @throw e; } memset(data, 0, size); return self; } |
︙ | ︙ |