Skip to content
Permalink
Browse files

Fix memory leak

  • Loading branch information
nyalldawson committed Nov 20, 2017
1 parent 4e16665 commit 89f6ca9f18a5a974678d40da2606f6b3918a463a
@@ -26,7 +26,11 @@ Tree model for the rules:
#include "qgsrulebasedrendererwidget.h"
%End
public:
QgsRuleBasedRendererModel( QgsRuleBasedRenderer *r );

QgsRuleBasedRendererModel( QgsRuleBasedRenderer *renderer, QObject *parent );
%Docstring
Constructor for QgsRuleBasedRendererModel, for the specified ``renderer``.
%End

virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
@@ -71,7 +71,7 @@ QgsRuleBasedRendererWidget::QgsRuleBasedRendererWidget( QgsVectorLayer *layer, Q
setupUi( this );
this->layout()->setContentsMargins( 0, 0, 0, 0 );

mModel = new QgsRuleBasedRendererModel( mRenderer );
mModel = new QgsRuleBasedRendererModel( mRenderer, viewRules );
#ifdef ENABLE_MODELTEST
new ModelTest( mModel, this ); // for model validity checking
#endif
@@ -799,8 +799,9 @@ void QgsRendererRulePropsWidget::setDockMode( bool dockMode )

/////

QgsRuleBasedRendererModel::QgsRuleBasedRendererModel( QgsRuleBasedRenderer *r )
: mR( r )
QgsRuleBasedRendererModel::QgsRuleBasedRendererModel( QgsRuleBasedRenderer *renderer, QObject *parent )
: QAbstractItemModel( parent )
, mR( renderer )
{
}

@@ -49,7 +49,11 @@ class GUI_EXPORT QgsRuleBasedRendererModel : public QAbstractItemModel
Q_OBJECT

public:
QgsRuleBasedRendererModel( QgsRuleBasedRenderer *r );

/**
* Constructor for QgsRuleBasedRendererModel, for the specified \a renderer.
*/
QgsRuleBasedRendererModel( QgsRuleBasedRenderer *renderer, QObject *parent );

virtual Qt::ItemFlags flags( const QModelIndex &index ) const override;
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;

0 comments on commit 89f6ca9

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