From 47862bbfe2610debff4e48c969703f85d2bb2aff Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Mon, 14 Nov 2022 12:19:34 -0800 Subject: [PATCH] [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 --- objectivec/GPBDescriptor.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/objectivec/GPBDescriptor.m b/objectivec/GPBDescriptor.m index 1b75f8e742..f1e06ee77d 100644 --- a/objectivec/GPBDescriptor.m +++ b/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.