Skip to content

Commit 8a949fa

Browse files
committed
Fix some leaks
1 parent 366331c commit 8a949fa

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/core/qgsdataitem.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ QgsDataItem::~QgsDataItem()
239239
mDeferredDelete = true;
240240
mFutureWatcher->waitForFinished();
241241
}
242+
243+
delete mFutureWatcher;
242244
}
243245

244246
QString QgsDataItem::pathComponent( const QString &string )

‎src/core/qgsproviderregistry.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ QgsProviderRegistry::~QgsProviderRegistry()
237237
if ( cleanupFunc )
238238
cleanupFunc();
239239
}
240+
delete it->second;
240241
++it;
241242
}
242243
}

‎tests/src/core/testqgsdataitem.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ void TestQgsDataItem::testDirItemChildren()
172172
}
173173

174174
}
175+
qDeleteAll( children );
175176

176177
delete dirItem;
177178
}

‎tests/src/core/testqgsrastersublayer.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ void TestQgsRasterSubLayer::initTestCase()
103103
myRasterFileInfo.completeBaseName() );
104104
qDebug() << "raster metadata: " << mpRasterLayer->dataProvider()->metadata();
105105
mReport += "raster metadata: " + mpRasterLayer->dataProvider()->metadata();
106-
107-
QgsMapLayerRegistry::instance()->addMapLayer( mpRasterLayer );
108106
}
109107
else
110108
{
@@ -115,6 +113,7 @@ void TestQgsRasterSubLayer::initTestCase()
115113
//runs after all tests
116114
void TestQgsRasterSubLayer::cleanupTestCase()
117115
{
116+
delete mpRasterLayer;
118117
QgsApplication::exitQgis();
119118
QString myReportFile = QDir::tempPath() + "/qgistest.html";
120119
QFile myFile( myReportFile );

0 commit comments

Comments
 (0)