Skip to content
Browse files
[composer] Fix crash caused by 7773d4e
Don't set the parent object of a composition to a composer view, as
we manage deletion of compositions manually and don't always want
the composition deleted when a view a deleted.
  • Loading branch information
nyalldawson committed Oct 19, 2014
1 parent 8732cbf commit 7798bd8abbcdd8015d0dc8540bd9dcf5313a71e6
Showing with 12 additions and 1 deletion.
  1. +0 −1 src/app/composer/qgscomposer.cpp
  2. +12 −0 src/app/qgisapp.cpp
@@ -504,7 +504,6 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )

mComposition->setParent( mView );
mView->setComposition( mComposition );
//this connection is set up after setting the view's composition, as we don't want setComposition called
//for new composers
@@ -5375,7 +5375,19 @@ void QgisApp::deleteComposer( QgsComposer* c )
mPrintComposersMenu->removeAction( c->windowAction() );
emit composerRemoved( c->view() );

//save a reference to the 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 c;

//next, delete the composition
if ( composition )
delete composition;

QgsComposer* QgisApp::duplicateComposer( QgsComposer* currentComposer, QString title )

0 comments on commit 7798bd8

Please sign in to comment.