Skip to content

Commit 728b9fc

Browse files
committedOct 25, 2018
Avoid heap allocations
1 parent 4fdec37 commit 728b9fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/app/qgisappstylesheet.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,12 @@ QMap<QString, QVariant> QgisAppStyleSheet::defaultOptions()
6868
// make sure family exists on system
6969
if ( fontFamily != mDefaultFont.family() )
7070
{
71-
QFont *tempFont = new QFont( fontFamily );
72-
if ( tempFont->family() != fontFamily )
71+
QFont tempFont( fontFamily );
72+
if ( tempFont.family() != fontFamily )
7373
{
7474
// missing from system, drop back to default
7575
fontFamily = mDefaultFont.family();
7676
}
77-
delete tempFont;
7877
}
7978
QgsDebugMsg( QStringLiteral( "fontFamily: %1" ).arg( fontFamily ) );
8079
opts.insert( QStringLiteral( "fontFamily" ), QVariant( fontFamily ) );

0 commit comments

Comments
 (0)
Please sign in to comment.