Fixes for mingw and vc.

This commit is contained in:
Martín Lucas Golini
2020-08-18 02:02:44 -03:00
parent 2c9e58763b
commit 2a81ade262
5 changed files with 77 additions and 8 deletions

View File

@@ -446,6 +446,9 @@ FontTrueType& FontTrueType::operator=( const FontTrueType& right ) {
void FontTrueType::cleanup() {
sendEvent( Event::Unload );
mCallbacks.clear();
mNumCallBacks = 0;
// Check if we must destroy the FreeType pointers
if ( mRefCount ) {
// Decrease the reference counter

View File

@@ -105,8 +105,9 @@ void SortingProxyModel::resort( unsigned flags ) {
return;
}
std::sort( mRowMappings.begin(), mRowMappings.end(), [&]( auto row1, auto row2 ) -> bool {
Variant data1 = target().data( target().index( row1, mKeyColumn ), mSortRole );
Variant data2 = target().data( target().index( row2, mKeyColumn ), mSortRole );
Model& target = this->target();
Variant data1 = target.data( target.index( row1, mKeyColumn ), mSortRole );
Variant data2 = target.data( target.index( row2, mKeyColumn ), mSortRole );
if ( data1 == data2 )
return 0;
bool isLessThan;

View File

@@ -53,10 +53,18 @@ Drawable* UIGlyphIcon::getSize( const int& size ) const {
UIGlyphIcon::UIGlyphIcon( const std::string& name, FontTrueType* font, const Uint32& codePoint ) :
UIIcon( name ), mFont( font ), mCodePoint( codePoint ) {
eeASSERT( mFont );
mFont->pushFontEventCallback( [&]( Uint32, Font::Event event, Font* ) {
mCloseCb = mFont->pushFontEventCallback( [&]( Uint32, Font::Event event, Font* ) {
if ( event == Font::Event::Unload )
mFont = nullptr;
} );
}
UIGlyphIcon::~UIGlyphIcon() {
if ( mFont && mCloseCb != 0 ) {
mFont->popFontEventCallback( mCloseCb );
mFont = nullptr;
mCloseCb = 0;
}
}
}} // namespace EE::UI