<table><tr><td style="">davidedmundson created this revision.<br />davidedmundson added a reviewer: Plasma.<br />davidedmundson added a subscriber: plasma-devel.<br />davidedmundson added a project: Plasma.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D3124" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>I didn't like the last fix, here's another one, which is maybe a bit<br />
neater?</p>
<p>We have a SourceModel that inherits from AbastractModel<br />
AbastractModel inherits from both QObject and Ref.</p>
<p>When we call the destructor of Ref, that kills the<br />
Pulseaudio::context that emits that the default source has changed during it's teardown.</p>
<p>Because the QObject destructor hasn't run yet, our signals are still<br />
attached; however they refer to data from SourceModel which we've<br />
already run the destructor on - hence crash.</p>
<p>This patch does the ref counting in an alternate way, destroying<br />
the PA Context after our model has disconnected all the<br />
signals, like it would be if the context was a child of the model.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>ran kquitapp5 plasmashell a lot, everything still seems fine.</p>
<p>I couldn't recreate the original crash, it requires<br />
multiple outputs being deleted in the wrong order, which I<br />
don't happen to have.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rPLASMAPA Plasma Audio Volume Applet</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3124" rel="noreferrer">https://phabricator.kde.org/D3124</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/CMakeLists.txt<br />
src/pulseaudio.cpp<br />
src/pulseaudio.h<br />
src/ref.cpp<br />
src/ref.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>davidedmundson, Plasma<br /><strong>Cc: </strong>plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas<br /></div>