summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/fx_font.h3
-rw-r--r--core/fxge/ge/cfx_font.cpp5
2 files changed, 4 insertions, 4 deletions
diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h
index ce91e27c42..946c713418 100644
--- a/core/fxge/fx_font.h
+++ b/core/fxge/fx_font.h
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/dib/cfx_dibitmap.h"
@@ -172,7 +173,7 @@ class CFX_Font {
void ClearFaceCache();
FXFT_Face m_Face;
- mutable CFX_FaceCache* m_FaceCache; // not owned.
+ mutable CFX_UnownedPtr<CFX_FaceCache> m_FaceCache;
std::unique_ptr<CFX_SubstFont> m_pSubstFont;
std::vector<uint8_t> m_pFontDataAllocation;
uint8_t* m_pFontData;
diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp
index 2ae34f11b9..18baed9d09 100644
--- a/core/fxge/ge/cfx_font.cpp
+++ b/core/fxge/ge/cfx_font.cpp
@@ -537,10 +537,9 @@ int CFX_Font::GetMaxAdvanceWidth() const {
}
CFX_FaceCache* CFX_Font::GetFaceCache() const {
- if (!m_FaceCache) {
+ if (!m_FaceCache)
m_FaceCache = CFX_GEModule::Get()->GetFontCache()->GetCachedFace(this);
- }
- return m_FaceCache;
+ return m_FaceCache.Get();
}
void CFX_Font::ClearFaceCache() {