Skip to content

Commit

Permalink
Fix a memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 19, 2015
1 parent 23edcdb commit 9bce9ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/app/qgswelcomepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
recentProjctsContainer->layout()->addWidget( recentProjectsTitle );

QListView* welcomeScreenListView = new QListView();
mModel = new QgsWelcomePageItemsModel();
mModel = new QgsWelcomePageItemsModel( welcomeScreenListView );
welcomeScreenListView->setModel( mModel );
welcomeScreenListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding );
welcomeScreenListView->setStyleSheet( "QListView::item {"
Expand All @@ -65,7 +65,6 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )

layout->addWidget( recentProjctsContainer );


QWidget* whatsNewContainer = new QWidget;
whatsNewContainer->setLayout( new QVBoxLayout );
QLabel* whatsNewTitle = new QLabel( QString( "<h1>%1</h1>").arg( tr( "QGIS News" ) ) );
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgswelcomepageitemsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

#include <QPixmap>

QgsWelcomePageItemsModel::QgsWelcomePageItemsModel()
QgsWelcomePageItemsModel::QgsWelcomePageItemsModel(QObject* parent)
: QAbstractListModel( parent )
{

}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgswelcomepageitemsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class QgsWelcomePageItemsModel : public QAbstractListModel
QString previewImagePath;
};

QgsWelcomePageItemsModel();
QgsWelcomePageItemsModel( QObject* parent = 0 );

void setRecentProjects(const QList<RecentProjectData>& recentProjects );

Expand Down

0 comments on commit 9bce9ed

Please sign in to comment.