Skip to content

Commit c0f4d0f

Browse files
committedDec 12, 2017
Fix a crash on exit
1 parent 6f47c6a commit c0f4d0f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎src/gui/layout/qgslayoutviewtoolselect.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ QgsLayoutViewToolSelect::QgsLayoutViewToolSelect( QgsLayoutView *view )
3333
QgsLayoutViewToolSelect::~QgsLayoutViewToolSelect()
3434
{
3535
if ( mMouseHandles )
36+
{
37+
// want to force them to be removed from the scene
38+
if ( mMouseHandles->scene() )
39+
mMouseHandles->scene()->removeItem( mMouseHandles );
3640
mMouseHandles->deleteLater();
41+
}
3742
}
3843

3944
void QgsLayoutViewToolSelect::layoutPressEvent( QgsLayoutViewMouseEvent *event )

‎src/gui/layout/qgslayoutviewtoolselect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class GUI_EXPORT QgsLayoutViewToolSelect : public QgsLayoutViewTool
7373
//! Start of rubber band creation
7474
QPointF mRubberBandStartPos;
7575

76-
QgsLayoutMouseHandles *mMouseHandles = nullptr; //owned by scene
76+
QPointer< QgsLayoutMouseHandles > mMouseHandles; //owned by scene
7777
};
7878

7979
#endif // QGSLAYOUTVIEWTOOLSELECT_H

0 commit comments

Comments
 (0)
Please sign in to comment.