Fix crash on application shutdown
ClosedPublic

Authored by davidedmundson on Oct 21 2016, 12:05 AM.

Details

Reviewers
drosca
Group Reviewers
Plasma
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.

Diff Detail

Repository
R115 Plasma Audio Volume Applet
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson retitled this revision from to Fix crash on application shutdown.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 21 2016, 12:05 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
drosca accepted this revision.Oct 21 2016, 8:20 AM
drosca added a reviewer: drosca.
drosca added a subscriber: drosca.
drosca added inline comments.
src/pulseaudio.cpp
321

extra newline

This revision is now accepted and ready to land.Oct 21 2016, 8:20 AM