Skip to content

Commit

Permalink
[layouts] Fix crash on report section delete
Browse files Browse the repository at this point in the history
Fixes #19447
  • Loading branch information
nyalldawson committed Aug 13, 2018
1 parent 73f3164 commit 6e2e073
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/gui/layout/qgslayoutview.cpp
Expand Up @@ -92,21 +92,17 @@ void QgsLayoutView::setCurrentLayout( QgsLayout *layout )

viewChanged();

delete mSnapMarker;
// IMPORTANT!
// previous snap markers, snap lines are owned by previous layout - so don't delete them here!
mSnapMarker = new QgsLayoutViewSnapMarker();
mSnapMarker->hide();
layout->addItem( mSnapMarker );

delete mHorizontalSnapLine;
mHorizontalSnapLine = createSnapLine();
mHorizontalSnapLine->hide();
layout->addItem( mHorizontalSnapLine );
delete mVerticalSnapLine;
mVerticalSnapLine = createSnapLine();
mVerticalSnapLine->hide();
layout->addItem( mVerticalSnapLine );

delete mSectionLabel;
mSectionLabel = nullptr;

if ( mHorizontalRuler )
Expand Down

0 comments on commit 6e2e073

Please sign in to comment.