Skip to content

Commit 69a6c0f

Browse files
committed
Move FcFini to ~Visualiser
1 parent 8f2407a commit 69a6c0f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/flamegpu/visualiser/Visualiser.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include "flamegpu/visualiser/multipass/FrameBufferAttachment.h"
2929
#include "util/Resources.h"
3030

31+
#if defined(__GNUC__) || defined(__clang__)
32+
#include <fontconfig/fontconfig.h>
33+
#endif
34+
3135
namespace flamegpu {
3236
namespace visualiser {
3337

@@ -226,6 +230,10 @@ Visualiser::Visualiser(const ModelConfig& modelcfg)
226230
}
227231
Visualiser::~Visualiser() {
228232
this->close();
233+
#if defined(__GNUC__) || defined(__clang__)
234+
// Fully clean up font config
235+
FcFini();
236+
#endif
229237
}
230238
void Visualiser::start() {
231239
// Only execute if background thread is not active

src/flamegpu/visualiser/util/fonts.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ std::string fontSearch(const std::string commaSeparatedfonts) {
9494
FcConfigDestroy(config);
9595
config = nullptr;
9696

97-
// Fully clean up font config - this should probably be in a called-once function rather than on each invocation
98-
FcFini();
99-
10097
// Return the path to the desired font.
10198
return fontpath;
10299
}

0 commit comments

Comments
 (0)