Skip to content
Permalink
Browse files

Add QgsStyle::cleanDefaultStyle() and use it in QgsApplication::exitQ…

…gis()
  • Loading branch information
rouault committed Jun 3, 2018
1 parent 8aeb2f6 commit b21701b5d74ceae47d1ee60781bfd2bb8f6d0d1e
@@ -134,6 +134,7 @@ returns 0 if not found
Returns default application-wide style
%End


bool tagSymbol( StyleEntity type, const QString &symbol, const QStringList &tags );
%Docstring
Tags the symbol with the tags in the list
@@ -47,6 +47,7 @@
#include "qgs3drendererregistry.h"
#include "qgslayoutrendercontext.h"
#include "qgssqliteutils.h"
#include "qgsstyle.h"

#include "gps/qgsgpsconnectionregistry.h"
#include "processing/qgsprocessingregistry.h"
@@ -1084,6 +1085,8 @@ void QgsApplication::exitQgis()

delete QgsProviderRegistry::instance();

QgsStyle::cleanDefaultStyle();

// tear-down GDAL/OGR
OGRCleanupAll();
GDALDestroyDriverManager();
@@ -68,6 +68,11 @@ QgsStyle *QgsStyle::defaultStyle() // static
return sDefaultStyle;
}

void QgsStyle::cleanDefaultStyle() // static
{
delete sDefaultStyle;
sDefaultStyle = nullptr;
}

void QgsStyle::clear()
{
@@ -167,6 +167,9 @@ class CORE_EXPORT QgsStyle : public QObject
//! Returns default application-wide style
static QgsStyle *defaultStyle();

//! Deletes the default style. Only to be used by QgsApplication::exitQgis()
static void cleanDefaultStyle() SIP_SKIP;

/**
* Tags the symbol with the tags in the list
*

0 comments on commit b21701b

Please sign in to comment.
You can’t perform that action at this time.