Skip to content

Commit b55ab2e

Browse files
committed
[win] Cleanup notifications on exit
1 parent 8f1fb1e commit b55ab2e

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

src/app/qgisapp.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,8 @@ QgisApp::~QgisApp()
15321532
delete canvas;
15331533
}
15341534

1535+
QgsGui::instance()->nativePlatformInterface()->cleanup();
1536+
15351537
// This function *MUST* be the last one called, as it destroys in
15361538
// particular GDAL. As above objects can hold GDAL/OGR objects, it is not
15371539
// safe destroying them afterwards

src/native/qgsnative.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include <QUrl>
2222
#include <QFileInfo>
2323

24+
void QgsNative::cleanup()
25+
{}
26+
2427
QgsNative::Capabilities QgsNative::capabilities() const
2528
{
2629
return nullptr;

src/native/qgsnative.h

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class NATIVE_EXPORT QgsNative
4646

4747
virtual ~QgsNative() = default;
4848

49+
/**
50+
* Called on QGIS exit, allowing the native interface to gracefully
51+
* cleanup and exit.
52+
*/
53+
virtual void cleanup();
54+
4955
/**
5056
* Returns the native interface's capabilities.
5157
*/

src/native/win/qgswinnative.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ void QgsWinNative::initializeMainWindow( QWindow *window,
5858
}
5959
}
6060

61+
void QgsWinNative::cleanup()
62+
{
63+
WinToastLib::WinToast::instance()->clear();
64+
}
65+
6166
void QgsWinNative::openFileExplorerAndSelectFile( const QString &path )
6267
{
6368
const QString nativePath = QDir::toNativeSeparators( path );

src/native/win/qgswinnative.h

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class NATIVE_EXPORT QgsWinNative : public QgsNative
3535
const QString &applicationName,
3636
const QString &organizationName,
3737
const QString &version ) override;
38+
void cleanup() override;
3839
void openFileExplorerAndSelectFile( const QString &path ) override;
3940
void showUndefinedApplicationProgress() override;
4041
void setApplicationProgress( double progress ) override;

0 commit comments

Comments
 (0)