mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Fix memory leak
This commit is contained in:
parent
8593f3ab9e
commit
e861f33b54
@ -4127,9 +4127,9 @@ void TestQgsGeometry::circle()
|
||||
|
||||
//test conversion
|
||||
QgsPointSequence ptsPol;
|
||||
QgsPolygonV2 *pol = new QgsPolygonV2();
|
||||
std::unique_ptr< QgsPolygonV2 > pol( new QgsPolygonV2() );
|
||||
// polygon
|
||||
pol = QgsCircle( QgsPointV2( 0, 0 ), 5 ).toPolygon( 4 );
|
||||
pol.reset( QgsCircle( QgsPointV2( 0, 0 ), 5 ).toPolygon( 4 ) );
|
||||
QCOMPARE( pol->numInteriorRings(), 0 );
|
||||
QCOMPARE( pol->exteriorRing()->numPoints(), 5 );
|
||||
|
||||
@ -4144,7 +4144,7 @@ void TestQgsGeometry::circle()
|
||||
// oriented
|
||||
//45
|
||||
double val = 5 * sin( M_PI / 4 );
|
||||
pol = QgsCircle( QgsPointV2( 0, 0 ), 5, 45 ).toPolygon( 4 );
|
||||
pol.reset( QgsCircle( QgsPointV2( 0, 0 ), 5, 45 ).toPolygon( 4 ) );
|
||||
QCOMPARE( pol->numInteriorRings(), 0 );
|
||||
QCOMPARE( pol->exteriorRing()->numPoints(), 5 );
|
||||
pol->exteriorRing()->points( ptsPol );
|
||||
@ -4155,7 +4155,7 @@ void TestQgsGeometry::circle()
|
||||
QVERIFY( ptsPol.at( 3 ) == QgsPointV2( -val, val ) );
|
||||
QVERIFY( ptsPol.at( 4 ) == QgsPointV2( val, val ) );
|
||||
//135
|
||||
pol = QgsCircle( QgsPointV2( 0, 0 ), 5, 135 ).toPolygon( 4 );
|
||||
pol.reset( QgsCircle( QgsPointV2( 0, 0 ), 5, 135 ).toPolygon( 4 ) );
|
||||
QCOMPARE( pol->numInteriorRings(), 0 );
|
||||
QCOMPARE( pol->exteriorRing()->numPoints(), 5 );
|
||||
pol->exteriorRing()->points( ptsPol );
|
||||
@ -4166,7 +4166,7 @@ void TestQgsGeometry::circle()
|
||||
QVERIFY( ptsPol.at( 3 ) == QgsPointV2( val, val ) );
|
||||
QVERIFY( ptsPol.at( 4 ) == QgsPointV2( val, -val ) );
|
||||
//225
|
||||
pol = QgsCircle( QgsPointV2( 0, 0 ), 5, 225 ).toPolygon( 4 );
|
||||
pol.reset( QgsCircle( QgsPointV2( 0, 0 ), 5, 225 ).toPolygon( 4 ) );
|
||||
QCOMPARE( pol->numInteriorRings(), 0 );
|
||||
QCOMPARE( pol->exteriorRing()->numPoints(), 5 );
|
||||
pol->exteriorRing()->points( ptsPol );
|
||||
@ -4177,7 +4177,7 @@ void TestQgsGeometry::circle()
|
||||
QVERIFY( ptsPol.at( 3 ) == QgsPointV2( val, -val ) );
|
||||
QVERIFY( ptsPol.at( 4 ) == QgsPointV2( -val, -val ) );
|
||||
//315
|
||||
pol = QgsCircle( QgsPointV2( 0, 0 ), 5, 315 ).toPolygon( 4 );
|
||||
pol.reset( QgsCircle( QgsPointV2( 0, 0 ), 5, 315 ).toPolygon( 4 ) );
|
||||
QCOMPARE( pol->numInteriorRings(), 0 );
|
||||
QCOMPARE( pol->exteriorRing()->numPoints(), 5 );
|
||||
pol->exteriorRing()->points( ptsPol );
|
||||
|
Loading…
x
Reference in New Issue
Block a user