Skip to content

Commit c278869

Browse files
manisandronyalldawson
authored andcommitted
Don't keep dangling pointers in QgisApp::mPrintComposers
1 parent 481b192 commit c278869

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/qgisapp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5654,7 +5654,7 @@ bool QgisApp::loadComposersFromProject( const QDomDocument& doc )
56545654
void QgisApp::deletePrintComposers()
56555655
{
56565656
QSet<QgsComposer*>::iterator it = mPrintComposers.begin();
5657-
for ( ; it != mPrintComposers.end(); ++it )
5657+
while ( it != mPrintComposers.end() )
56585658
{
56595659
emit composerWillBeRemoved(( *it )->view() );
56605660

@@ -5670,8 +5670,8 @@ void QgisApp::deletePrintComposers()
56705670
{
56715671
delete composition;
56725672
}
5673+
it = mPrintComposers.erase( it );
56735674
}
5674-
mPrintComposers.clear();
56755675
mLastComposerId = 0;
56765676
markDirty();
56775677
}

0 commit comments

Comments
 (0)