Closed skaarj1989 closed 8 months ago
Thank you! I've been keeping a note on this bug for too long now.
However, I'm not sure if this is a sufficient fix. Since we keep a reference to the font interface inside RmlUi until shutdown, we easily risk use-after free here. Plus, it breaks the shutdown in reverse initialization order, which is a good idiom to follow.
If you look at the Rml::Shutdown procedure, you can see the appropriate shutdown order for the default interface. Ideally we would have the same order for the bitmap font engine. Any ideas?
I resolved this issue a bit differently: 64b36dc4775e3c2eefcd93bdb873cc402c0bbcea.
Thanks for reporting and the suggested solution.
The
font_interface
should be cleared beforeRml::Shutdown
A validrender_interface
(non nullptr) is required for unloadingTextureResource
in thefont_interface
https://github.com/mikke89/RmlUi/blob/c54ef6ebc1f3eedf8c70a18fb8266ba97b96d4c7/Samples/basic/bitmapfont/src/FontEngineBitmap.cpp#L43