From 5c7e5ffefc301f49c0e11421014340b404d9d5a5 Mon Sep 17 00:00:00 2001 From: donghualin Date: Mon, 25 Oct 2021 11:20:48 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A0=8F=E5=86=85=E5=AD=98=E6=B3=84=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复任务栏内存泄露,不影响功能 Log: 修复任务栏内存泄露 Influence: 任务栏 Task: https://pms.uniontech.com/zentao/task-view-88885.html Change-Id: Id0e1ecd672c91dce79d66c2d45115279657948a1 --- frame/window/mainpanelcontrol.cpp | 2 ++ plugins/sound/soundaccessible.h | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frame/window/mainpanelcontrol.cpp b/frame/window/mainpanelcontrol.cpp index 24a834111..7abfc3533 100755 --- a/frame/window/mainpanelcontrol.cpp +++ b/frame/window/mainpanelcontrol.cpp @@ -302,6 +302,8 @@ void MainPanelControl::removePluginAreaItem(QWidget *wdg) if (boxLayout && boxLayout->itemAt(0)->widget() == wdg) { boxLayout->removeWidget(wdg); m_pluginLayout->removeItem(layoutItem); + delete layoutItem; + layoutItem = nullptr; } } } diff --git a/plugins/sound/soundaccessible.h b/plugins/sound/soundaccessible.h index 699ece981..d89bde7b7 100644 --- a/plugins/sound/soundaccessible.h +++ b/plugins/sound/soundaccessible.h @@ -14,9 +14,9 @@ QAccessibleInterface *soundAccessibleFactory(const QString &classname, QObject * { QAccessibleInterface *interface = nullptr; - USE_ACCESSIBLE(classname, SoundItem); - USE_ACCESSIBLE(classname, SoundApplet); - USE_ACCESSIBLE(classname, VolumeSlider); + USE_ACCESSIBLE(classname, SoundItem) + ELSE_USE_ACCESSIBLE(classname, SoundApplet) + ELSE_USE_ACCESSIBLE(classname, VolumeSlider); return interface; }