davidedmundson created this revision. davidedmundson added a reviewer: Plasma. Restricted Application added a project: Plasma. Restricted Application added a subscriber: plasma-devel.
REVISION SUMMARY We have a SourceModel that inherits from AbastractModel AbastractModel inherits from both QObject and Ref. When we call the destructor of Ref, that kills the Pulseaudio::context that emits that the default source has changed during it's teardown. Because the QObject destructor hasn't run yet, our signals are still attached; however they refer to data from SourceModel which we've already run the destructor on - hence crash. This patch disconnects in SourceModel::~SourceModel avoiding any of those problems. TEST PLAN kquitapp5 plasma a lot, everything still seems fine. I couldn't recreate the original crash, it requires multiple outputs being deleted in the wrong order, which I don't happen to have. REPOSITORY rPLASMAPA Plasma Audio Volume Applet BRANCH master REVISION DETAIL https://phabricator.kde.org/D3123 AFFECTED FILES src/pulseaudio.cpp src/pulseaudio.h EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: davidedmundson, #plasma Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas