[Differential] [Request, 119 lines] D3124: Fix crash in application shutdown (alternate fix)

davidedmundson (David Edmundson) noreply at phabricator.kde.org
Fri Oct 21 00:13:41 UTC 2016


davidedmundson created this revision.
davidedmundson added a reviewer: Plasma.
davidedmundson added a subscriber: plasma-devel.
davidedmundson added a project: Plasma.

REVISION SUMMARY
  I didn't like the last fix, here's another one, which is maybe a bit
  neater?
  
  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 does the ref counting in an alternate way, destroying
  the PA Context after our model has disconnected all the
  signals, like it would be if the context was a child of the model.

TEST PLAN
  ran  kquitapp5 plasmashell 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/D3124

AFFECTED FILES
  src/CMakeLists.txt
  src/pulseaudio.cpp
  src/pulseaudio.h
  src/ref.cpp
  src/ref.h

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: davidedmundson, #plasma
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161021/6db639c2/attachment.html>


More information about the Plasma-devel mailing list