chore: 修复任务栏内存泄露

修复任务栏内存泄露,不影响功能

Log: 修复任务栏内存泄露
Influence: 任务栏
Task: https://pms.uniontech.com/zentao/task-view-88885.html
Change-Id: I3c1ecf8e0f404c216e3bd055bf11136c8bce69e5
This commit is contained in:
donghualin 2021-10-28 11:41:51 +08:00 committed by fanpengcheng
parent fdd2c679e4
commit 5a1f0c9bf8
2 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@ using namespace Dock;
SoundItem::SoundItem(QWidget *parent)
: QWidget(parent)
, m_tipsLabel(new TipsWidget(this))
, m_applet(new SoundApplet(this))
, m_applet(new SoundApplet)
, m_sinkInter(nullptr)
{
m_tipsLabel->setAccessibleName("soundtips");
@ -55,8 +55,8 @@ SoundItem::SoundItem(QWidget *parent)
m_applet->setVisible(false);
connect(m_applet, &SoundApplet::defaultSinkChanged, this, &SoundItem::sinkChanged);
connect(m_applet, &SoundApplet::volumeChanged, this, &SoundItem::refresh, Qt::QueuedConnection);
connect(m_applet.get(), &SoundApplet::defaultSinkChanged, this, &SoundItem::sinkChanged);
connect(m_applet.get(), &SoundApplet::volumeChanged, this, &SoundItem::refresh, Qt::QueuedConnection);
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ] {
refreshIcon();
@ -78,7 +78,7 @@ QWidget *SoundItem::tipsWidget()
QWidget *SoundItem::popupApplet()
{
return m_applet;
return m_applet.get();
}
const QString SoundItem::contextMenu()

View File

@ -65,7 +65,7 @@ private slots:
private:
Dock::TipsWidget *m_tipsLabel;
SoundApplet *m_applet;
QScopedPointer<SoundApplet> m_applet;
DBusSink *m_sinkInter;
QPixmap m_iconPixmap;
};