summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-05-07 23:30:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-07 23:30:22 +0000
commitb4f1a027cbadd4cd07341f60f859ae34643b68ae (patch)
treea031884521e267d102a69211d69f6da71b7121db /libs
parentde9ae529b1784bf74ef2a96a38bc0ccd782cf4e5 (diff)
parent1bf3b4a06d92e728b9e32d560b54cb41a562dde0 (diff)
downloadframeworks_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.cpp4
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,