提交 ac274331 编写于 作者: B Behdad Esfahbod

In lazy-loading, remember allocation failure

上级 29fb0cb7
......@@ -447,11 +447,13 @@ struct hb_lazy_loader_t
{
p = (T *) calloc (1, sizeof (T));
if (unlikely (!p))
return &OT::Null(T);
p->init (face);
p = const_cast<T *> (&OT::Null(T));
else
p->init (face);
if (unlikely (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), NULL, p)))
{
p->fini ();
if (p != &OT::Null(T))
p->fini ();
goto retry;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册