aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBRootObject.m
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@google.com>2015-06-24 09:00:09 -0700
committerJan Tattermusch <jtattermusch@google.com>2015-06-24 09:00:09 -0700
commitfbd735c5d76a860e75005090a89aa2ea88d8eb6c (patch)
treea2d15c207f332a122049c66289393e6e878ffb35 /objectivec/GPBRootObject.m
parent659a43b5935f4afc9d00e1dd742e4210e000ab53 (diff)
parent242fdef65a3eb681ce686c0a68c7d33d4fb2ea1a (diff)
downloadprotobuf-fbd735c5d76a860e75005090a89aa2ea88d8eb6c.tar.gz
protobuf-fbd735c5d76a860e75005090a89aa2ea88d8eb6c.tar.bz2
protobuf-fbd735c5d76a860e75005090a89aa2ea88d8eb6c.zip
Merge remote-tracking branch 'upstream/master' into fix_appveyor
Diffstat (limited to 'objectivec/GPBRootObject.m')
-rw-r--r--objectivec/GPBRootObject.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/objectivec/GPBRootObject.m b/objectivec/GPBRootObject.m
index 3f648257..7036723f 100644
--- a/objectivec/GPBRootObject.m
+++ b/objectivec/GPBRootObject.m
@@ -36,6 +36,7 @@
#import <CoreFoundation/CoreFoundation.h>
#import "GPBDescriptor.h"
+#import "GPBExtensionRegistry.h"
#import "GPBUtilities_PackagePrivate.h"
@interface GPBExtensionDescriptor (GPBRootObject)
@@ -97,6 +98,7 @@ static CFHashCode GPBRootExtensionKeyHash(const void *value) {
static OSSpinLock gExtensionSingletonDictionaryLock_ = OS_SPINLOCK_INIT;
static CFMutableDictionaryRef gExtensionSingletonDictionary = NULL;
+static GPBExtensionRegistry *gDefaultExtensionRegistry = NULL;
+ (void)initialize {
// Ensure the global is started up.
@@ -113,6 +115,7 @@ static CFMutableDictionaryRef gExtensionSingletonDictionary = NULL;
gExtensionSingletonDictionary =
CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &keyCallBacks,
&kCFTypeDictionaryValueCallBacks);
+ gDefaultExtensionRegistry = [[GPBExtensionRegistry alloc] init];
}
if ([self superclass] == [GPBRootObject class]) {
@@ -126,7 +129,7 @@ static CFMutableDictionaryRef gExtensionSingletonDictionary = NULL;
+ (GPBExtensionRegistry *)extensionRegistry {
// Is overridden in all the subclasses that provide extensions to provide the
// per class one.
- return nil;
+ return gDefaultExtensionRegistry;
}
+ (void)globallyRegisterExtension:(GPBExtensionDescriptor *)field {