Skip to content

Commit

Permalink
Avoid heap allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 25, 2018
1 parent 4fdec37 commit 728b9fc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/qgisappstylesheet.cpp
Expand Up @@ -68,13 +68,12 @@ QMap<QString, QVariant> QgisAppStyleSheet::defaultOptions()
// make sure family exists on system
if ( fontFamily != mDefaultFont.family() )
{
QFont *tempFont = new QFont( fontFamily );
if ( tempFont->family() != fontFamily )
QFont tempFont( fontFamily );
if ( tempFont.family() != fontFamily )
{
// missing from system, drop back to default
fontFamily = mDefaultFont.family();
}
delete tempFont;
}
QgsDebugMsg( QStringLiteral( "fontFamily: %1" ).arg( fontFamily ) );
opts.insert( QStringLiteral( "fontFamily" ), QVariant( fontFamily ) );
Expand Down

0 comments on commit 728b9fc

Please sign in to comment.