Skip to content

Commit

Permalink
Fix a crash on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 12, 2017
1 parent 6f47c6a commit c0f4d0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/gui/layout/qgslayoutviewtoolselect.cpp
Expand Up @@ -33,7 +33,12 @@ QgsLayoutViewToolSelect::QgsLayoutViewToolSelect( QgsLayoutView *view )
QgsLayoutViewToolSelect::~QgsLayoutViewToolSelect()
{
if ( mMouseHandles )
{
// want to force them to be removed from the scene
if ( mMouseHandles->scene() )
mMouseHandles->scene()->removeItem( mMouseHandles );
mMouseHandles->deleteLater();
}
}

void QgsLayoutViewToolSelect::layoutPressEvent( QgsLayoutViewMouseEvent *event )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutviewtoolselect.h
Expand Up @@ -73,7 +73,7 @@ class GUI_EXPORT QgsLayoutViewToolSelect : public QgsLayoutViewTool
//! Start of rubber band creation
QPointF mRubberBandStartPos;

QgsLayoutMouseHandles *mMouseHandles = nullptr; //owned by scene
QPointer< QgsLayoutMouseHandles > mMouseHandles; //owned by scene
};

#endif // QGSLAYOUTVIEWTOOLSELECT_H

0 comments on commit c0f4d0f

Please sign in to comment.