Skip to content

Commit

Permalink
Fix some leaks in QgisApp
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 28, 2015
1 parent dec4f5c commit a8f85fb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ QgisApp::~QgisApp()
delete mComposerManager;

delete mVectorLayerTools;
delete mWelcomePage;

deletePrintComposers();
removeAnnotationItems();
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsadvanceddigitizingdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ QgsAdvancedDigitizingDockWidget::QgsAdvancedDigitizingDockWidget( QgsMapCanvas*
QgsAdvancedDigitizingDockWidget::~QgsAdvancedDigitizingDockWidget()
{
delete mErrorMessage;
delete mCadPaintItem;
delete mAngleConstraint;

This comment has been minimized.

Copy link
@3nids

3nids Aug 28, 2015

Member

had to remove this

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Aug 28, 2015

Author Collaborator

Sorry about that.... A bit overzealous!

delete mDistanceConstraint;
delete mXConstraint;
delete mYConstraint;

}

void QgsAdvancedDigitizingDockWidget::hideEvent( QHideEvent* )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsbookmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ QgsBookmarks::QgsBookmarks( QWidget *parent ) : QDockWidget( parent )
btnImpExp->setIcon( QgsApplication::getThemeIcon( "/mActionSharing.svg" ) );
btnImpExp->setPopupMode( QToolButton::InstantPopup );

QMenu *share = new QMenu();
QMenu *share = new QMenu( this );
QAction *btnExport = share->addAction( tr( "&Export" ) );
QAction *btnImport = share->addAction( tr( "&Import" ) );
btnExport->setIcon( QgsApplication::getThemeIcon( "/mActionSharingExport.svg" ) );
Expand Down
11 changes: 8 additions & 3 deletions src/app/qgswelcomepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,18 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
mainLayout->addWidget( mVersionInformation );
mVersionInformation->setVisible( false );

QgsVersionInfo* versionInfo = new QgsVersionInfo();
connect( versionInfo, SIGNAL( versionInfoAvailable() ), this, SLOT( versionInfoReceived() ) );
versionInfo->checkVersion();
mVersionInfo = new QgsVersionInfo();
connect( mVersionInfo, SIGNAL( versionInfoAvailable() ), this, SLOT( versionInfoReceived() ) );
mVersionInfo->checkVersion();

connect( recentProjectsListView, SIGNAL( activated( QModelIndex ) ), this, SLOT( itemActivated( QModelIndex ) ) );
}

QgsWelcomePage::~QgsWelcomePage()
{
delete mVersionInfo;
}

void QgsWelcomePage::setRecentProjects( const QList<QgsWelcomePageItemsModel::RecentProjectData>& recentProjects )
{
mModel->setRecentProjects( recentProjects );
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgswelcomepage.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@

#include "qgswelcomepageitemsmodel.h"

class QgsVersionInfo;

class QgsWelcomePage : public QTabWidget
{
Q_OBJECT

public:
QgsWelcomePage( QWidget* parent = 0 );

~QgsWelcomePage();

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

private slots:
Expand All @@ -39,6 +43,7 @@ class QgsWelcomePage : public QTabWidget
private:
QgsWelcomePageItemsModel* mModel;
QLabel* mVersionInformation;
QgsVersionInfo* mVersionInfo;
};

#endif // QGSWELCOMEDIALOG_H

0 comments on commit a8f85fb

Please sign in to comment.