mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-04-05 04:06:08 +00:00
Oops, StringImpl's "the empty string" global was not always initialized.
These "oops forgot to initialize" bugs are getting annoying...
This commit is contained in:
@@ -4,12 +4,17 @@
|
||||
|
||||
namespace AK {
|
||||
|
||||
static StringImpl* s_theEmptyStringImpl = nullptr;
|
||||
|
||||
void StringImpl::initializeGlobals()
|
||||
{
|
||||
s_theEmptyStringImpl = new StringImpl(ConstructTheEmptyStringImpl);;
|
||||
}
|
||||
|
||||
StringImpl& StringImpl::theEmptyStringImpl()
|
||||
{
|
||||
static StringImpl* s = nullptr;
|
||||
if (!s)
|
||||
s = new StringImpl(ConstructTheEmptyStringImpl);
|
||||
return *s;
|
||||
ASSERT(s_theEmptyStringImpl);
|
||||
return *s_theEmptyStringImpl;
|
||||
}
|
||||
|
||||
StringImpl::~StringImpl()
|
||||
|
||||
Reference in New Issue
Block a user