diff options
Diffstat (limited to 'src/crepe/facade/Font.cpp')
-rw-r--r-- | src/crepe/facade/Font.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/crepe/facade/Font.cpp b/src/crepe/facade/Font.cpp index 1ee3de1..83e8519 100644 --- a/src/crepe/facade/Font.cpp +++ b/src/crepe/facade/Font.cpp @@ -1,4 +1,5 @@ #include "../api/Config.h" +#include "util/Log.h" #include "Font.h" @@ -6,8 +7,8 @@ using namespace std; using namespace crepe; Font::Font(const Asset & src, Mediator & mediator) - : Resource(src, mediator), - font(nullptr, TTF_CloseFont) { + : Resource(src, mediator) { + dbg_trace(); Config & config = Config::get_instance(); const std::string FONT_PATH = src.get_path(); TTF_Font * font = TTF_OpenFont(FONT_PATH.c_str(), config.font.size); @@ -16,4 +17,9 @@ Font::Font(const Asset & src, Mediator & mediator) this->font = {font, [](TTF_Font * font) { TTF_CloseFont(font); }}; } +Font::~Font(){ + dbg_trace(); + this->font.reset(); +} + TTF_Font * Font::get_font() const { return this->font.get(); } |