Skip to content
Permalink
Browse files

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
  • Loading branch information
nyalldawson committed May 30, 2015
1 parent df9e596 commit 174943e2db53f8d6892c25f0bc584b9cfa181e1f
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/app/qgisapp.cpp
@@ -5656,21 +5656,23 @@ void QgisApp::deletePrintComposers()
QSet<QgsComposer*>::iterator it = mPrintComposers.begin();
while ( it != mPrintComposers.end() )
{
emit composerWillBeRemoved(( *it )->view() );
QgsComposer* c = ( *it );
emit composerWillBeRemoved( c->view() );
it = mPrintComposers.erase( it );
emit composerRemoved( c->view() );

//save a reference to the composition
QgsComposition* composition = ( *it )->composition();
QgsComposition* composition = c->composition();

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

//next, delete the composition
if ( composition )
{
delete composition;
}
it = mPrintComposers.erase( it );
}
mLastComposerId = 0;
markDirty();

0 comments on commit 174943e

Please sign in to comment.
You can’t perform that action at this time.