mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 16:31:14 +01:00
Make lazy loader deal with OOM
This commit is contained in:
1 parent
30ff8ac865
commit
7df7963b46
1 file changed
+5
-1
@@ -623,7 +623,11 @@ struct hb_lazy_loader_t
|
||||
if (unlikely (!p))
|
||||
{
|
||||
hb_face_t *face = *(((hb_face_t **) this) - WheresFace);
|
||||
p = thiz ()->create (face);
|
||||
if (likely (!p))
|
||||
p = thiz ()->create (face);
|
||||
if (unlikely (!p))
|
||||
p = thiz ()->create (nullptr); /* Produce nil object. */
|
||||
assert (p);
|
||||
if (unlikely (!hb_atomic_ptr_cmpexch (const_cast<Stored **>(&this->instance), nullptr, p)))
|
||||
{
|
||||
thiz ()->destroy (p);
|
||||
|
||||
Reference in new issue
Block a user