Skip to content

Commit

Permalink
Fix some Coverity use-after-free warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 3, 2018
1 parent cf905c9 commit eb39579
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7446,8 +7446,10 @@ QgsLayoutDesignerDialog *QgisApp::createNewPrintLayout( const QString &t )
QgsPrintLayout *layout = new QgsPrintLayout( QgsProject::instance() );
layout->setName( title );
layout->initializeDefaults();
QgsProject::instance()->layoutManager()->addLayout( layout );
return openLayoutDesignerDialog( layout );
if ( QgsProject::instance()->layoutManager()->addLayout( layout ) )
return openLayoutDesignerDialog( layout );
else
return nullptr;
}

QgsLayoutDesignerDialog *QgisApp::createNewReport( QString title )
Expand Down
4 changes: 2 additions & 2 deletions src/core/processing/models/qgsprocessingmodelalgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,8 @@ bool QgsProcessingModelAlgorithm::activateChildAlgorithm( const QString &id )

void QgsProcessingModelAlgorithm::addModelParameter( QgsProcessingParameterDefinition *definition, const QgsProcessingModelParameter &component )
{
addParameter( definition );
mParameterComponents.insert( definition->name(), component );
if ( addParameter( definition ) )
mParameterComponents.insert( definition->name(), component );
}

void QgsProcessingModelAlgorithm::updateModelParameter( QgsProcessingParameterDefinition *definition )
Expand Down

0 comments on commit eb39579

Please sign in to comment.