Skip to content

Commit

Permalink
Fix memory leak in rulebased renderer sip bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 18, 2016
1 parent 2246dcc commit 3529433
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/core/symbology-ng/qgsrulebasedrendererv2.sip
Expand Up @@ -274,7 +274,7 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
void removeChildAt( int i );

//! take child rule out, set parent as null
void takeChild( QgsRuleBasedRendererV2::Rule* rule );
QgsRuleBasedRendererV2::Rule* takeChild( QgsRuleBasedRendererV2::Rule* rule ) /TransferBack/;

//! take child rule out, set parent as null
QgsRuleBasedRendererV2::Rule* takeChildAt( int i ) /TransferBack/;
Expand Down
3 changes: 2 additions & 1 deletion src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Expand Up @@ -111,11 +111,12 @@ void QgsRuleBasedRendererV2::Rule::removeChildAt( int i )
updateElseRules();
}

void QgsRuleBasedRendererV2::Rule::takeChild( Rule* rule )
QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::takeChild( Rule* rule )
{
mChildren.removeAll( rule );
rule->mParent = nullptr;
updateElseRules();
return rule;
}

QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::takeChildAt( int i )
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsrulebasedrendererv2.h
Expand Up @@ -317,7 +317,7 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2
void removeChildAt( int i );

//! take child rule out, set parent as null
void takeChild( Rule* rule );
Rule* takeChild( Rule* rule );

//! take child rule out, set parent as null
Rule* takeChildAt( int i );
Expand Down

0 comments on commit 3529433

Please sign in to comment.