@@ -568,9 +568,10 @@ void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
568568{
569569 Q_UNUSED(parent)
570570
571+ ApplicationInfoInterface *app = m_appManager->get(row);
571572 int appIndex = -1;
572573 for (int i = 0; i < m_list.count(); ++i) {
573− if (m_list.at(i)->appId() == m_appManager->get(row)->appId()) {
574+ if (m_list.at(i)->appId() == app->appId()) {
574575 appIndex = i;
575576 break;
576577 }
@@ -581,6 +582,8 @@ void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
581582 return;
582583 }
583584
585+ disconnect(app, &ApplicationInfoInterface::surfaceCountChanged, this, &LauncherModel::applicationSurfaceCountChanged);
586+
584587 LauncherItem * item = m_list.at(appIndex);
585588 item->setRunning(false);
586589