File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -5465,8 +5465,19 @@ void QgisApp::deletePrintComposers()
5465
5465
for ( ; it != mPrintComposers .end (); ++it )
5466
5466
{
5467
5467
emit composerWillBeRemoved (( *it )->view () );
5468
- delete (( *it )->composition () );
5468
+
5469
+ // save a reference to the composition
5470
+ QgsComposition* composition = ( *it )->composition ();
5471
+
5472
+ // first, delete the composer. This must occur before deleting the composition as some of the cleanup code in
5473
+ // composer or in composer item widgets may require the composition to still be around
5469
5474
delete ( *it );
5475
+
5476
+ // next, delete the composition
5477
+ if ( composition )
5478
+ {
5479
+ delete composition;
5480
+ }
5470
5481
}
5471
5482
mPrintComposers .clear ();
5472
5483
mLastComposerId = 0 ;
You can’t perform that action at this time.
0 commit comments