summaryrefslogtreecommitdiffstats
path: root/libs/utils/String8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/utils/String8.cpp')
-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,