File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,10 @@ void QgsStacItemItem::setStacItem( std::unique_ptr< QgsStacObject > &object )
178
178
{
179
179
QgsStacItem *item = dynamic_cast <QgsStacItem *>( object.get () );
180
180
if ( item )
181
- object.release ();
181
+ {
182
+ // release object, mStacItem will take ownership of the successfully cast item
183
+ ( void )object.release ();
184
+ }
182
185
183
186
mStacItem .reset ( item );
184
187
updateToolTip ();
@@ -463,7 +466,10 @@ void QgsStacCatalogItem::setStacCatalog( std::unique_ptr< QgsStacObject > &objec
463
466
{
464
467
QgsStacCatalog *catalog = dynamic_cast <QgsStacCatalog *>( object.get () );
465
468
if ( catalog )
466
- object.release ();
469
+ {
470
+ // release object, mStacCatalog will take ownership of the successfully cast catalog
471
+ ( void )object.release ();
472
+ }
467
473
468
474
mStacCatalog .reset ( catalog );
469
475
if ( mStacCatalog )
You can’t perform that action at this time.
0 commit comments