after discussion with @LukasHejl it will be better to not call FcFini
This commit is contained in:
parent
c96f642b0a
commit
5632c21dec
1 changed files with 7 additions and 1 deletions
|
@ -8,16 +8,22 @@
|
|||
|
||||
using namespace Slic3r::GUI;
|
||||
|
||||
|
||||
// @Vojta suggest to make static variable global
|
||||
// Guard for finalize Font Config
|
||||
// Will be finalized on application exit
|
||||
// It seams that it NOT work
|
||||
static std::optional<Slic3r::ScopeGuard> finalize_guard;
|
||||
|
||||
std::string Slic3r::GUI::get_font_path(const wxFont &font)
|
||||
{
|
||||
if (!finalize_guard.has_value()) {
|
||||
FcInit();
|
||||
finalize_guard.emplace([]() { FcFini(); });
|
||||
finalize_guard.emplace([]() {
|
||||
// Some internal problem of Font config or other library use FC too(like wxWidget)
|
||||
// fccache.c:795: FcCacheFini: Assertion `fcCacheChains[i] == NULL' failed.
|
||||
//FcFini();
|
||||
});
|
||||
}
|
||||
|
||||
FcConfig *fc = FcInitLoadConfigAndFonts();
|
||||
|
|
Loading…
Add table
Reference in a new issue