Skip to content

Commit

Permalink
Fix possible error when messagebar items are popped and events are qu…
Browse files Browse the repository at this point in the history
…eued
  • Loading branch information
nyalldawson committed Jul 6, 2017
1 parent ac9a39f commit 1ab9c99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/qgsmessagebar.cpp
Expand Up @@ -131,7 +131,7 @@ void QgsMessageBar::popItem( QgsMessageBarItem *item )
mLayout->removeWidget( widget );
mCurrentItem->hide();
disconnect( mCurrentItem, &QgsMessageBarItem::styleChanged, this, &QWidget::setStyleSheet );
delete mCurrentItem;
mCurrentItem->deleteLater();
mCurrentItem = nullptr;
}

Expand Down Expand Up @@ -168,7 +168,7 @@ bool QgsMessageBar::popWidget( QgsMessageBarItem *item )
if ( existingItem == item )
{
mItems.removeOne( existingItem );
delete existingItem;
existingItem->deleteLater();
return true;
}
}
Expand Down

0 comments on commit 1ab9c99

Please sign in to comment.