| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5959e70 commit 06c22a6
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -201,10 +201,18 @@ - (short)getShortWithId:(id)object { | |||
| 201 | 201 | } | |
| 202 | 202 | ||
| 203 | 203 | - (void)setWithId:(id)object withId:(id)value { | |
| 204 | - J2ObjcRawValue rawValue; | ||
| 204 | + // TODO(kstanger): correctly handle @Weak fields. | ||
| 205 | 205 | IOSClass *fieldType = [self getType]; | |
| 206 | + BOOL needsRetain = ![fieldType isPrimitive]; | ||
| 207 | + if (needsRetain) { | ||
| 208 | + AUTORELEASE([self getWithId:object]); | ||
| 209 | + } | ||
| 210 | + J2ObjcRawValue rawValue; | ||
| 206 | 211 | [fieldType __unboxValue:value toRawValue:&rawValue]; | |
| 207 | 212 | SetWithRawValue(&rawValue, self, object, fieldType); | |
| 213 | + if (needsRetain) { | ||
| 214 | + RETAIN_(value); | ||
| 215 | + } | ||
| 208 | 216 | } | |
| 209 | 217 | ||
| 210 | 218 | - (void)setBooleanWithId:(id)object withBoolean:(BOOL)value { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments