Skip to content

Commit 802f7f5

Browse files
committed
[layouts] Fix crash on report section delete
Fixes #19447 (cherry-picked from 6e2e073)
1 parent c058a68 commit 802f7f5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/gui/layout/qgslayoutview.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,17 @@ void QgsLayoutView::setCurrentLayout( QgsLayout *layout )
9292

9393
viewChanged();
9494

95-
delete mSnapMarker;
95+
// IMPORTANT!
96+
// previous snap markers, snap lines are owned by previous layout - so don't delete them here!
9697
mSnapMarker = new QgsLayoutViewSnapMarker();
9798
mSnapMarker->hide();
9899
layout->addItem( mSnapMarker );
99-
100-
delete mHorizontalSnapLine;
101100
mHorizontalSnapLine = createSnapLine();
102101
mHorizontalSnapLine->hide();
103102
layout->addItem( mHorizontalSnapLine );
104-
delete mVerticalSnapLine;
105103
mVerticalSnapLine = createSnapLine();
106104
mVerticalSnapLine->hide();
107105
layout->addItem( mVerticalSnapLine );
108-
109-
delete mSectionLabel;
110106
mSectionLabel = nullptr;
111107

112108
if ( mHorizontalRuler )

0 commit comments

Comments
 (0)