aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/GPBDescriptor.m
diff options
context:
space:
mode:
Diffstat (limited to 'objectivec/GPBDescriptor.m')
-rw-r--r--objectivec/GPBDescriptor.m15
1 files changed, 14 insertions, 1 deletions
diff --git a/objectivec/GPBDescriptor.m b/objectivec/GPBDescriptor.m
index 90636d3d..0212fb0d 100644
--- a/objectivec/GPBDescriptor.m
+++ b/objectivec/GPBDescriptor.m
@@ -36,6 +36,12 @@
#import "GPBWireFormat.h"
#import "GPBMessage_PackagePrivate.h"
+// Direct access is use for speed, to avoid even internally declaring things
+// read/write, etc. The warning is enabled in the project to ensure code calling
+// protos can turn on -Wdirect-ivar-access without issues.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdirect-ivar-access"
+
// The address of this variable is used as a key for obj_getAssociatedObject.
static const char kTextFormatExtraValueKey = 0;
@@ -265,6 +271,11 @@ static NSArray *NewFieldsArrayForHasIndex(int hasIndex,
return self;
}
+- (void)dealloc {
+ [package_ release];
+ [super dealloc];
+}
+
@end
@implementation GPBOneofDescriptor
@@ -820,7 +831,7 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
if ((self = [super init])) {
description_ = description;
-#if DEBUG
+#if defined(DEBUG) && DEBUG
const char *className = description->messageOrGroupClassName;
if (className) {
NSAssert(objc_lookUpClass(className) != Nil,
@@ -978,3 +989,5 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
}
@end
+
+#pragma clang diagnostic pop