[ObjC] Bring back the explicit getter for enumDescriptor.

The static analyzer in some versions of Xcode now flag the enumDescriptor_ as
retained by the generated methods and not being release in dealloc. So avoid the
whole issue by just bringing back the explicit getter.

PiperOrigin-RevId: 488436139
pull/10985/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent d4adb43bb4
commit 47862bbfe2
  1. 5
      objectivec/GPBDescriptor.m

@ -448,7 +448,6 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
@synthesize msgClass = msgClass_;
@synthesize containingOneof = containingOneof_;
@synthesize enumDescriptor = enumDescriptor_;
- (instancetype)initWithFieldDescription:(void *)description
includesDefault:(BOOL)includesDefault
@ -623,6 +622,10 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
return enumDescriptor_.enumVerifier(value);
}
- (GPBEnumDescriptor *)enumDescriptor {
return enumDescriptor_;
}
- (GPBGenericValue)defaultValue {
// Depends on the fact that defaultValue_ is initialized either to "0/nil" or
// to an actual defaultValue in our initializer.

Loading…
Cancel
Save