Fix crash when dragging a tab off QDockWidgetGroupWindow

Crashes later in QMainWindowLayout::hover()

Change-Id: Ibf1085ebfa7b0edcbd1662b0300550788b7f9c33
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Sergio Martins 2016-12-05 22:04:25 +00:00 committed by Sérgio Martins
parent 3c4febf557
commit 0382bb2ab8
1 changed files with 3 additions and 1 deletions

View File

@ -797,8 +797,10 @@ void QDockWidgetPrivate::endDrag(bool abort)
if (abort || !mwLayout->plug(state->widgetItem)) {
if (hasFeature(this, QDockWidget::DockWidgetFloatable)) {
// This QDockWidget will now stay in the floating state.
if (state->ownWidgetItem)
if (state->ownWidgetItem) {
delete state->widgetItem;
state->widgetItem = nullptr;
}
mwLayout->restore();
QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);
if (!dwLayout->nativeWindowDeco()) {