Skip to content

Commit 0a44aee

Browse files
caimc123456deepin-bot[bot]
authored andcommitted
fix: handle removal of pending app items
1. Add check for pending app items in watchingAppItemRemoved 2. Handle cleanup of items in m_pendingAppItems container 3. Prevent potential memory leaks from unmanaged pending items 4. Ensure early return logic to avoid processing invalid active items 5. Improve app lifecycle management during installation or initialization Influence: 1. Test removing applications while they are in a pending state 2. Verify system stability when cancelling app installations 3. Check logs for "Removing pending app item" debug messages 4. Monitor for memory leaks during repeated app install/remove cycles 5. Ensure app icons disappear correctly after pending removal PMS: BUG-347859
1 parent 424540a commit 0a44aee

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/ddeintegration/appmgr.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,15 @@ void AppMgr::watchingAppItemAdded(const QString &key, AppItem *appItem)
532532

533533
void AppMgr::watchingAppItemRemoved(const QString &key)
534534
{
535+
// Check if the item is in pending container
536+
if (m_pendingAppItems.contains(key)) {
537+
auto pendingAppItem = m_pendingAppItems.value(key);
538+
qCDebug(logDdeIntegration) << "Removing pending app item, desktopId" << pendingAppItem->id;
539+
m_pendingAppItems.remove(key);
540+
delete pendingAppItem;
541+
return;
542+
}
543+
535544
auto appItem = m_appItems.value(key);
536545
if (!appItem) {
537546
qCWarning(logDdeIntegration) << "App item not found for key:" << key;

0 commit comments

Comments
 (0)