Skip to content

Commit

Permalink
Fix invalid read when closing layout designers
Browse files Browse the repository at this point in the history
Child widget was referring to its parent in the destructor - at
this stage the parent may no longer be in a usable state (if the
child's destruction was caused by the parent's destruction)
  • Loading branch information
nyalldawson committed Jan 22, 2018
1 parent 35a7701 commit cbe6416
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/gui/layout/qgslayoutviewtool.cpp
Expand Up @@ -49,7 +49,8 @@ QList<QgsLayoutItem *> QgsLayoutViewTool::ignoredSnapItems() const

QgsLayoutViewTool::~QgsLayoutViewTool()
{
mView->unsetTool( this );
if ( mView )
mView->unsetTool( this );
}

QgsLayoutViewTool::Flags QgsLayoutViewTool::flags() const
Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutviewtool.h
Expand Up @@ -215,7 +215,7 @@ class GUI_EXPORT QgsLayoutViewTool : public QObject
private:

//! Pointer to layout view.
QgsLayoutView *mView = nullptr;
QPointer< QgsLayoutView > mView;

QgsLayoutViewTool::Flags mFlags = nullptr;

Expand Down

0 comments on commit cbe6416

Please sign in to comment.