bugfix: remove item crash

remove-animation still running and the target item has been delete by other,
when animation finish, use an invalid pointer cause crash

Change-Id: Ic3de07dca716d0447ba709b2f0af420a41f4f5db
This commit is contained in:
杨万青 2015-10-22 17:26:43 +08:00 committed by yangwanqing
parent 8df96a4945
commit 065b943b92
Notes: Deepin Code Review 2016-06-14 07:19:47 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: <mr.asianwang@gmail.com>
Submitted-by: <mr.asianwang@gmail.com>
Submitted-at: Thu, 22 Oct 2015 19:03:57 +0800
Reviewed-on: https://cr.deepin.io/8008
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -76,17 +76,8 @@ void DockLayout::moveItem(int from, int to)
void DockLayout::removeItem(int index)
{
//Qt5.3.* not support singleshot with lamda expressions
QTimer *delayTimer = new QTimer(this);
connect(delayTimer, &QTimer::timeout, [=] {
delayTimer->stop();
delayTimer->deleteLater();
m_appList.removeAt(index);
removeSpacingItem();
relayout();
});
delayTimer->start(m_removeItemDelayInterval);
m_appList.removeAt(index);
relayout();
}
void DockLayout::removeItem(AbstractDockItem *item)