Differences From Artifact [9f48848034]:
- File src/OFArray.m — part of check-in [7107bd9906] at 2009-05-18 20:41:47 on branch trunk — Add one more convenience method to OFArray. (user: js, size: 3697) [annotate] [blame] [check-ins using]
To Artifact [47830eac24]:
- File
src/OFArray.m
— part of check-in
[cc6d2d3987]
at
2009-05-18 22:09:42
on branch trunk
— Fix error handling in init methods in OFArray.
Actually, directly retaining them is required, as dealloc will release
them. (user: js, size: 3410) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
93 94 95 96 97 98 99 | return ret; } - initWithObject: (OFObject*)first andArgList: (va_list)args { id obj; | < < | > > < < < < < < < < | > > < < < < | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | return ret; } - initWithObject: (OFObject*)first andArgList: (va_list)args { id obj; self = [self init]; @try { [array add: &first]; while ((obj = va_arg(args, id)) != nil) { [array add: &obj]; [obj retain]; } } @catch (OFException *e) { [self dealloc]; @throw e; } return self; } - initWithCArray: (OFObject**)objs { id *obj; self = [self init]; @try { for (obj = objs; *obj != nil; obj++) { [array add: obj]; [*obj retain]; } } @catch (OFException *e) { [self dealloc]; @throw e; } return self; } - (size_t)count { return [array count]; } |
︙ | ︙ |