diff options
author | Todd Poynor <toddpoynor@google.com> | 2013-05-07 23:30:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-05-07 23:30:22 +0000 |
commit | b4f1a027cbadd4cd07341f60f859ae34643b68ae (patch) | |
tree | a031884521e267d102a69211d69f6da71b7121db /libs | |
parent | de9ae529b1784bf74ef2a96a38bc0ccd782cf4e5 (diff) | |
parent | 1bf3b4a06d92e728b9e32d560b54cb41a562dde0 (diff) | |
download | frameworks_native-b4f1a027cbadd4cd07341f60f859ae34643b68ae.zip frameworks_native-b4f1a027cbadd4cd07341f60f859ae34643b68ae.tar.gz frameworks_native-b4f1a027cbadd4cd07341f60f859ae34643b68ae.tar.bz2 |
Merge "String8: ensure static init done prior to empty string reference"
Diffstat (limited to 'libs')
-rw-r--r-- | libs/utils/String8.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp index 562f026..75daee9 100644 --- a/libs/utils/String8.cpp +++ b/libs/utils/String8.cpp @@ -48,12 +48,16 @@ int gDarwinIsReallyAnnoying; static inline char* getEmptyString() { + if (!gEmptyStringBuf) initialize_string8(); + gEmptyStringBuf->acquire(); return gEmptyString; } void initialize_string8() { + if (gEmptyStringBuf) return; + // HACK: This dummy dependency forces linking libutils Static.cpp, // which is needed to initialize String8/String16 classes. // These variables are named for Darwin, but are needed elsewhere too, |