Merge pull request #5071 from OPM/memory-fixes

Release of memory
This commit is contained in:
Magne Sjaastad
2019-11-21 07:10:07 +01:00
parent db869ccbd5
commit 72a5c6cfef
10 changed files with 43 additions and 18 deletions

View File

@@ -153,6 +153,9 @@ RiaApplication::RiaApplication()
RiaApplication::~RiaApplication()
{
delete m_preferences;
delete m_project;
RiaFontCache::clear();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -129,3 +129,11 @@ RiaFontCache::FontSize RiaFontCache::fontSizeEnumFromPointSize( int pointSize )
}
return closestEnumValue;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaFontCache::clear()
{
ms_fonts.clear();
}

View File

@@ -56,6 +56,8 @@ public:
static int pointSizeFromFontSizeEnum( FontSize fontSize );
static FontSize fontSizeEnumFromPointSize( int pointSize );
static void clear();
private:
static std::map<FontSize, cvf::ref<caf::FixedAtlasFont>> ms_fonts;
};