Skip to content
Permalink
Browse files

Fix invalid read when closing layout designers

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 cbe6416278bb7530b56faf8158f33664ce20c7b5
Showing with 3 additions and 2 deletions.
  1. +2 −1 src/gui/layout/qgslayoutviewtool.cpp
  2. +1 −1 src/gui/layout/qgslayoutviewtool.h
@@ -49,7 +49,8 @@ QList<QgsLayoutItem *> QgsLayoutViewTool::ignoredSnapItems() const

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

QgsLayoutViewTool::Flags QgsLayoutViewTool::flags() const
@@ -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;

0 comments on commit cbe6416

Please sign in to comment.
You can’t perform that action at this time.