Avoid potential disconnect of all signals in IconItem

Summary:
m_svgIcon can be null.

disconnect(q, nullptr, nullptr, nullptr); would have pretty catastrophic
consequences as it disconnects everything. Anyone listening for
QObject::destroyed of IconItem for cleanup would no longer get anything.
That could lead to obscure conditions.

ShaderEffectSource watches for the source being destroyed for cleanup
and we have a newly introduced crash with ShaderEffectSource that seems
to come from this patch.

BUG: 421170

Test Plan:
Someone who could reproduce the crash reliably confirms it fixes the
issue

Reviewers: #plasma

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D29742
This commit is contained in:
David Edmundson 2020-05-14 12:19:27 +01:00
parent 54cc2200cc
commit c215c54ece

View File

@ -196,8 +196,10 @@ public:
}
~SvgSource() {
if (m_svgIcon) {
QObject::disconnect(m_iconItem, nullptr, m_svgIcon, nullptr);
}
}
bool isValid() const override
{