Skip to content

Commit f6965e2

Browse files
uclarosnyalldawson
authored andcommitted
explicitly discard return value when releasing
1 parent 4b4cb2f commit f6965e2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/core/stac/qgsstacdataitems.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ void QgsStacItemItem::setStacItem( std::unique_ptr< QgsStacObject > &object )
178178
{
179179
QgsStacItem *item = dynamic_cast<QgsStacItem *>( object.get() );
180180
if ( item )
181-
object.release();
181+
{
182+
// release object, mStacItem will take ownership of the successfully cast item
183+
( void )object.release();
184+
}
182185

183186
mStacItem.reset( item );
184187
updateToolTip();
@@ -463,7 +466,10 @@ void QgsStacCatalogItem::setStacCatalog( std::unique_ptr< QgsStacObject > &objec
463466
{
464467
QgsStacCatalog *catalog = dynamic_cast<QgsStacCatalog *>( object.get() );
465468
if ( catalog )
466-
object.release();
469+
{
470+
// release object, mStacCatalog will take ownership of the successfully cast catalog
471+
( void )object.release();
472+
}
467473

468474
mStacCatalog.reset( catalog );
469475
if ( mStacCatalog )

0 commit comments

Comments
 (0)