hwui: Fix multiple definitions of NativeFamilyBuilder
There are two _different_ definitions of the NativeFamilyBuilder class,
one in jni/FontFamily.cpp and the other in jni/fonts/FontFamily.cpp,
violating the one-definition rule. Make them local by moving to an
anonymous namespace.
This is an issue in non-optimized builds where ~NativeFamilyBuilder
isn't inlined, so the wrong destructor ends up being called:
```
(gdb) bt
[...]
#3 0x0000007292c44a8c in std::__1::vector<minikin::FontVariation,
std::__1::allocator<minikin::FontVariation> >::~vector ()
#4 0x0000007292c44a54 in android::NativeFamilyBuilder::~NativeFamilyBuilder ()
#8 0x0000007292c64cec in android::FontFamily_Builder_build ()
```
(note that the struct used by FontFamily_Builder_build() doesn't have
the vector<minikin::FontVariation> field)
Test: add "-O0" to hwui cflags and verify that system_server no longer
hangs on startup
Signed-off-by: Tomislav Novak <tnovak@meta.com>
Change-Id: Ic071a7c00a9b2f632b6f56877f54c6a58eb38965
Loading
Please register or sign in to comment