Functions marked with __attribute__((constructor)) can be called multiple times in some cases.
When registering fonts we raise an assertion in case of failure, initially to detect whether some other component registered the same fonts we do. But when adding the library to a unit test target the constructor, called twice, will assert the second time font registration is attempted.
Note that using dispatch_once does not work to prevent multiple execution in this case, it is therefore likely simpler to just remove the assertion.
Functions marked with
__attribute__((constructor))
can be called multiple times in some cases.When registering fonts we raise an assertion in case of failure, initially to detect whether some other component registered the same fonts we do. But when adding the library to a unit test target the constructor, called twice, will assert the second time font registration is attempted.
Note that using
dispatch_once
does not work to prevent multiple execution in this case, it is therefore likely simpler to just remove the assertion.Issue type
Crash (in debug mode only)
Environment information
Reproducibility
Always reproducible
Code sample
Code sample
Steps to reproduce