Skip to content

Commit

Permalink
use unique_ptr for projectexternalstorage instance
Browse files Browse the repository at this point in the history
  • Loading branch information
troopa81 committed Jul 30, 2021
1 parent ce6cc8d commit 49fcf89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/core/qgsapplication.cpp
Expand Up @@ -2425,7 +2425,7 @@ QgsScaleBarRendererRegistry *QgsApplication::scaleBarRendererRegistry()

QgsProjectStorageRegistry *QgsApplication::projectStorageRegistry()
{
return members()->mProjectStorageRegistry;
return members()->mProjectStorageRegistry.get();
}

QgsExternalStorageRegistry *QgsApplication::externalStorageRegistry()
Expand Down Expand Up @@ -2572,7 +2572,7 @@ QgsApplication::ApplicationMembers::ApplicationMembers()
}
{
profiler->start( tr( "Setup project storage registry" ) );
mProjectStorageRegistry = new QgsProjectStorageRegistry();
mProjectStorageRegistry.reset( new QgsProjectStorageRegistry() );
profiler->end();
}
{
Expand Down Expand Up @@ -2629,7 +2629,6 @@ QgsApplication::ApplicationMembers::~ApplicationMembers()
delete mPaintEffectRegistry;
delete mPluginLayerRegistry;
delete mProcessingRegistry;
delete mProjectStorageRegistry;
delete mPageSizeRegistry;
delete mAnnotationItemRegistry;
delete mLayoutItemRegistry;
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsapplication.h
Expand Up @@ -21,6 +21,7 @@
#include <QStringList>
#include <QColor>

#include <memory>
#include "qgis_sip.h"
#include "qgsconfig.h"
#include "qgssettingsentry.h"
Expand Down Expand Up @@ -1056,7 +1057,7 @@ class CORE_EXPORT QgsApplication : public QApplication
QgsClassificationMethodRegistry *mClassificationMethodRegistry = nullptr;
QgsProcessingRegistry *mProcessingRegistry = nullptr;
QgsConnectionRegistry *mConnectionRegistry = nullptr;
QgsProjectStorageRegistry *mProjectStorageRegistry = nullptr;
std::unique_ptr<QgsProjectStorageRegistry> mProjectStorageRegistry;
QgsExternalStorageRegistry *mExternalStorageRegistry = nullptr;
QgsPageSizeRegistry *mPageSizeRegistry = nullptr;
QgsRasterRendererRegistry *mRasterRendererRegistry = nullptr;
Expand Down

0 comments on commit 49fcf89

Please sign in to comment.