mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-16 20:51:46 +08:00
after discussion with @LukasHejl it will be better to not call FcFini
This commit is contained in:
parent
c96f642b0a
commit
5632c21dec
@ -8,16 +8,22 @@
|
|||||||
|
|
||||||
using namespace Slic3r::GUI;
|
using namespace Slic3r::GUI;
|
||||||
|
|
||||||
|
|
||||||
// @Vojta suggest to make static variable global
|
// @Vojta suggest to make static variable global
|
||||||
// Guard for finalize Font Config
|
// Guard for finalize Font Config
|
||||||
// Will be finalized on application exit
|
// Will be finalized on application exit
|
||||||
|
// It seams that it NOT work
|
||||||
static std::optional<Slic3r::ScopeGuard> finalize_guard;
|
static std::optional<Slic3r::ScopeGuard> finalize_guard;
|
||||||
|
|
||||||
std::string Slic3r::GUI::get_font_path(const wxFont &font)
|
std::string Slic3r::GUI::get_font_path(const wxFont &font)
|
||||||
{
|
{
|
||||||
if (!finalize_guard.has_value()) {
|
if (!finalize_guard.has_value()) {
|
||||||
FcInit();
|
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();
|
FcConfig *fc = FcInitLoadConfigAndFonts();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user