Skip to content

Commit 174943e

Browse files
committedJun 24, 2015
Correctly emit composerRemoved signal after removing composer
from print composers list, fixes composer manager showing invalid old compositions when loading new project (fix #12612) Cherry-picked from 3530e4c
1 parent df9e596 commit 174943e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5656,21 +5656,23 @@ void QgisApp::deletePrintComposers()
56565656
QSet<QgsComposer*>::iterator it = mPrintComposers.begin();
56575657
while ( it != mPrintComposers.end() )
56585658
{
5659-
emit composerWillBeRemoved(( *it )->view() );
5659+
QgsComposer* c = ( *it );
5660+
emit composerWillBeRemoved( c->view() );
5661+
it = mPrintComposers.erase( it );
5662+
emit composerRemoved( c->view() );
56605663

56615664
//save a reference to the composition
5662-
QgsComposition* composition = ( *it )->composition();
5665+
QgsComposition* composition = c->composition();
56635666

56645667
//first, delete the composer. This must occur before deleting the composition as some of the cleanup code in
56655668
//composer or in composer item widgets may require the composition to still be around
5666-
delete( *it );
5669+
delete( c );
56675670

56685671
//next, delete the composition
56695672
if ( composition )
56705673
{
56715674
delete composition;
56725675
}
5673-
it = mPrintComposers.erase( it );
56745676
}
56755677
mLastComposerId = 0;
56765678
markDirty();

0 commit comments

Comments
 (0)
Please sign in to comment.