Codechange: make explicit that virtual functions in a con/destructor are resolved statically
This as during construction the sub class has not been initialized yet, and during destruction the sub class has already been destroyed, so the overriding virtual function would be accessing uninitialized data.
This commit is contained in:
@@ -216,7 +216,8 @@ TrueTypeFontCache::TrueTypeFontCache(FontSize fs, int pixels) : FontCache(fs), r
|
||||
*/
|
||||
TrueTypeFontCache::~TrueTypeFontCache()
|
||||
{
|
||||
this->ClearFontCache();
|
||||
/* Virtual functions get called statically in destructors, so make it explicit to remove any confusion. */
|
||||
this->TrueTypeFontCache::ClearFontCache();
|
||||
|
||||
for (auto &iter : this->font_tables) {
|
||||
free(iter.second.second);
|
||||
|
Reference in New Issue
Block a user