Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
9784f0d1
Verified
Commit
9784f0d1
authored
May 17, 2022
by
Fushan Wen
Browse files
applets/kicker: delete SystemEntry if it's not valid
This fixes a memory leak.
parent
2cc819f3
Pipeline
#177549
passed with stage
in 8 minutes and 8 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
applets/kicker/plugin/systemmodel.cpp
View file @
9784f0d1
...
...
@@ -88,7 +88,9 @@ void SystemModel::refresh()
void
SystemModel
::
populate
()
{
qDeleteAll
(
m_entries
);
qDeleteAll
(
m_invalidEntries
);
m_entries
.
clear
();
m_invalidEntries
.
clear
();
auto
addIfValid
=
[
=
](
const
SystemEntry
::
Action
action
)
{
SystemEntry
*
entry
=
new
SystemEntry
(
this
,
action
);
...
...
@@ -96,6 +98,8 @@ void SystemModel::populate()
if
(
entry
->
isValid
())
{
m_entries
<<
entry
;
}
else
{
m_invalidEntries
<<
entry
;
}
QObject
::
connect
(
entry
,
&
SystemEntry
::
isValidChanged
,
this
,
&
AbstractModel
::
refresh
,
Qt
::
UniqueConnection
);
...
...
applets/kicker/plugin/systemmodel.h
View file @
9784f0d1
...
...
@@ -35,4 +35,5 @@ private:
void
populate
();
QVector
<
SystemEntry
*>
m_entries
;
decltype
(
m_entries
)
m_invalidEntries
;
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment