Skip to content

Commit 92af85b

Browse files
committedJul 7, 2015
coverity fixes
1 parent 05d7744 commit 92af85b

8 files changed

+17
-7
lines changed
 

‎src/core/qgspallabeling.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4052,7 +4052,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
40524052
double bbox[] = { extent.xMinimum(), extent.yMinimum(), extent.xMaximum(), extent.yMaximum() };
40534053

40544054
std::list<LabelPosition*>* labels;
4055-
pal::Problem* problem;
4055+
pal::Problem *problem;
40564056
try
40574057
{
40584058
problem = mPal->extractProblem( scale, bbox );
@@ -4066,7 +4066,10 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
40664066
}
40674067

40684068
if ( context.renderingStopped() )
4069+
{
4070+
delete problem;
40694071
return; // it has been cancelled
4072+
}
40704073

40714074
#if 1 // XXX strk
40724075
// features are pre-rotated but not scaled/translated,

‎tests/src/core/testqgscomposerdd.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class TestQgsComposerDD : public QObject
3939
public:
4040
TestQgsComposerDD()
4141
: mComposition( 0 )
42+
, mMapSettings( 0 )
4243
, mVectorLayer( 0 )
4344
, mAtlasMap( 0 )
4445
, mAtlas( 0 )

‎tests/src/core/testqgscomposergroup.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class TestQgsComposerGroup : public QObject
3131
public:
3232
TestQgsComposerGroup()
3333
: mComposition( 0 )
34+
, mMapSettings( 0 )
3435
, mItem1( 0 )
3536
, mItem2( 0 )
3637
, mGroup( 0 )

‎tests/src/core/testqgscomposermap.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class TestQgsComposerMap : public QObject
3434
TestQgsComposerMap()
3535
: mComposition( 0 )
3636
, mComposerMap( 0 )
37+
, mMapSettings( 0 )
3738
, mRasterLayer( 0 )
3839
{}
3940

‎tests/src/core/testqgscomposermapgrid.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,18 @@ class TestQgsComposerMapGrid : public QObject
6666
};
6767

6868
TestQgsComposerMapGrid::TestQgsComposerMapGrid()
69-
: mComposition( NULL )
70-
, mComposerMap( NULL )
69+
: mComposition( 0 )
70+
, mComposerMap( 0 )
71+
, mMapSettings( 0 )
7172
{
72-
QgsApplication::init();
73-
QgsApplication::initQgis();
74-
75-
mMapSettings = new QgsMapSettings();
7673
}
7774

7875
void TestQgsComposerMapGrid::initTestCase()
7976
{
77+
QgsApplication::init();
78+
QgsApplication::initQgis();
79+
mMapSettings = new QgsMapSettings();
80+
8081
mReport = "<h1>Composer Map Grid Tests</h1>\n";
8182
}
8283

‎tests/src/core/testqgscomposermodel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class TestQgsComposerModel : public QObject
3131
public:
3232
TestQgsComposerModel()
3333
: mComposition( 0 )
34+
, mMapSettings( 0 )
3435
, mItem1( 0 )
3536
, mItem2( 0 )
3637
, mItem3( 0 )

‎tests/src/core/testqgscomposerpaper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class TestQgsComposerPaper : public QObject
4040
, mMarkerLine( 0 )
4141
, mFillSymbol( 0 )
4242
, mMarkerLineSymbol( 0 )
43+
, mMapSettings( 0 )
4344
{}
4445

4546
private slots:

‎tests/src/core/testqgscomposershapes.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class TestQgsComposerShapes : public QObject
3636
TestQgsComposerShapes()
3737
: mComposition( 0 )
3838
, mComposerShape( 0 )
39+
, mMapSettings( 0 )
3940
, mSimpleFill( 0 )
4041
, mFillSymbol( 0 )
4142
{}

0 commit comments

Comments
 (0)
Please sign in to comment.