File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5729,21 +5729,23 @@ void QgisApp::deletePrintComposers()
5729
5729
QSet<QgsComposer*>::iterator it = mPrintComposers .begin ();
5730
5730
while ( it != mPrintComposers .end () )
5731
5731
{
5732
- emit composerWillBeRemoved (( *it )->view () );
5732
+ QgsComposer* c = ( *it );
5733
+ emit composerWillBeRemoved ( c->view () );
5734
+ it = mPrintComposers .erase ( it );
5735
+ emit composerRemoved ( c->view () );
5733
5736
5734
5737
// save a reference to the composition
5735
- QgsComposition* composition = ( *it ) ->composition ();
5738
+ QgsComposition* composition = c ->composition ();
5736
5739
5737
5740
// first, delete the composer. This must occur before deleting the composition as some of the cleanup code in
5738
5741
// composer or in composer item widgets may require the composition to still be around
5739
- delete ( *it );
5742
+ delete ( c );
5740
5743
5741
5744
// next, delete the composition
5742
5745
if ( composition )
5743
5746
{
5744
5747
delete composition;
5745
5748
}
5746
- it = mPrintComposers .erase ( it );
5747
5749
}
5748
5750
mLastComposerId = 0 ;
5749
5751
markDirty ();
You can’t perform that action at this time.
0 commit comments