Skip to content

Commit

Permalink
Fix leak, loss of connections to existing temporal properties caused
Browse files Browse the repository at this point in the history
by creating new object over existing one
  • Loading branch information
nyalldawson committed Mar 29, 2020
1 parent 57988a4 commit 23ef7bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -101,6 +101,7 @@ QgsRasterLayer::QgsRasterLayer()
: QgsMapLayer( QgsMapLayerType::RasterLayer )
, QSTRING_NOT_SET( QStringLiteral( "Not Set" ) )
, TRSTRING_NOT_SET( tr( "Not Set" ) )
, mTemporalProperties( new QgsRasterLayerTemporalProperties( this ) )

{
init();
Expand All @@ -115,6 +116,7 @@ QgsRasterLayer::QgsRasterLayer( const QString &uri,
// Constant that signals property not used.
, QSTRING_NOT_SET( QStringLiteral( "Not Set" ) )
, TRSTRING_NOT_SET( tr( "Not Set" ) )
, mTemporalProperties( new QgsRasterLayerTemporalProperties( this ) )
{
mShouldValidateCrs = !options.skipCrsValidation;

Expand Down Expand Up @@ -576,8 +578,6 @@ void QgsRasterLayer::init()
//Initialize the last view port structure, should really be a class
mLastViewPort.mWidth = 0;
mLastViewPort.mHeight = 0;

mTemporalProperties = new QgsRasterLayerTemporalProperties( this );
}

void QgsRasterLayer::setDataProvider( QString const &provider, const QgsDataProvider::ProviderOptions &options )
Expand Down

0 comments on commit 23ef7bf

Please sign in to comment.