Skip to content
Permalink
Browse files

Fix some leaks

  • Loading branch information
nyalldawson committed Oct 10, 2015
1 parent 4eb53d3 commit b69e076a51c1a9d132140426094648a20060859d
@@ -99,7 +99,7 @@ QMenu* QgsAppLayerTreeViewMenuProvider::createContextMenu()
// style-related actions
if ( layer && mView->selectedLayerNodes().count() == 1 )
{
QMenu *menuStyleManager = new QMenu( tr( "Styles" ) );
QMenu *menuStyleManager = new QMenu( tr( "Styles" ), menu );

QgisApp *app = QgisApp::instance();
menuStyleManager->addAction( tr( "Copy Style" ), app, SLOT( copyStyle() ) );
@@ -81,12 +81,12 @@ QList<QAction*> QgsMapLayerStyleGuiUtils::actionsUseStyle( QgsMapLayer* layer, Q

void QgsMapLayerStyleGuiUtils::addStyleManagerActions( QMenu* m, QgsMapLayer* layer )
{
m->addAction( actionAddStyle( layer ) );
m->addAction( actionAddStyle( layer, m ) );
if ( layer->styleManager()->styles().count() > 1 )
m->addAction( actionRemoveStyle( layer ) );
m->addAction( actionRenameStyle( layer ) );
m->addAction( actionRemoveStyle( layer, m ) );
m->addAction( actionRenameStyle( layer, m ) );
m->addSeparator();
Q_FOREACH ( QAction* a, actionsUseStyle( layer ) )
Q_FOREACH ( QAction* a, actionsUseStyle( layer, m ) )
m->addAction( a );
}

@@ -213,7 +213,7 @@ void QgsMapToolAddFeature::cadCanvasReleaseEvent( QgsMapMouseEvent* e )
}

//create QgsFeature with wkb representation
QgsFeature* f = new QgsFeature( vlayer->fields(), 0 );
QScopedPointer< QgsFeature > f( new QgsFeature( vlayer->fields(), 0 ) );

//does compoundcurve contain circular strings?
//does provider support circular strings?
@@ -258,7 +258,6 @@ void QgsMapToolAddFeature::cadCanvasReleaseEvent( QgsMapMouseEvent* e )
{
//bail out...
emit messageEmitted( tr( "The feature could not be added because removing the polygon intersections would change the geometry type" ), QgsMessageBar::CRITICAL );
delete f;
stopCapturing();
return;
}
@@ -280,13 +279,12 @@ void QgsMapToolAddFeature::cadCanvasReleaseEvent( QgsMapMouseEvent* e )
reason = tr( "The feature cannot be added because it's geometry collapsed due to intersection avoidance" );
}
emit messageEmitted( reason, QgsMessageBar::CRITICAL );
delete f;
stopCapturing();
return;
}
}

if ( addFeature( vlayer, f, false ) )
if ( addFeature( vlayer, f.data(), false ) )
{
//add points to other features to keep topology up-to-date
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );

0 comments on commit b69e076

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