Skip to content
Permalink
Browse files

Fix possible error when messagebar items are popped and events are qu…

…eued
  • Loading branch information
nyalldawson committed Jul 6, 2017
1 parent ac9a39f commit 1ab9c992b505a397e4789f8efd29579f1468b3a5
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/qgsmessagebar.cpp
@@ -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;
}

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

0 comments on commit 1ab9c99

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