summaryrefslogtreecommitdiff
path: root/ui/qt/rtp_audio_stream.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-11-28 15:53:59 +0100
committerPeter Wu <peter@lekensteyn.nl>2016-11-30 19:52:55 +0000
commit9887cd7feb7c377a3d046b924fe86907479be413 (patch)
treeb43792c60872e169d60182d515c8b3a0336f76ee /ui/qt/rtp_audio_stream.cpp
parent72427192723869535fb938425ddf8c5c4568ab5c (diff)
downloadwireshark-9887cd7feb7c377a3d046b924fe86907479be413.tar.gz
Qt: fix crash when closing RTP player while playing
For some time, the RTP Player has been crashing for me (Arch Linux, Qt 5.7.0) when the RTP Player is active (affects also Wireshark 2.0.5). This call trace was observed: + RtpPlayerDialog::reject (closing dialog via Escape / Close button) + RtpAudioStream::stopPlaying + RtpAudioStream::outputStateChanged(QAudio::StoppedState) + QAudioOutput::deleteLater // problematic! + RtpPlayerDialog::~RtpPlayerDialog + RtpAudioStream::~RtpAudioStream As the QAudioOutput instance is a child of RtpAudioStream, it is also destroyed after that. QAudioOutput's destructor somehow invokes (via libqtmedia_pulse.so) a main loop iteration which invokes the previously scheduled deleteLater call. As QAudioOutput was already being destructed, this results in a crash. Workaround this by removing this child from RtpAudioStream (no cruelty intended). Change-Id: I88f2e929ac566534be5d2270e2e0b194685533eb Reviewed-on: https://code.wireshark.org/review/18970 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/qt/rtp_audio_stream.cpp')
-rw-r--r--ui/qt/rtp_audio_stream.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp
index 7154d8df7a..1d8971c1d1 100644
--- a/ui/qt/rtp_audio_stream.cpp
+++ b/ui/qt/rtp_audio_stream.cpp
@@ -576,6 +576,9 @@ void RtpAudioStream::outputStateChanged(QAudio::State new_state)
switch (new_state) {
case QAudio::StoppedState:
// RTP_STREAM_DEBUG("stopped %f", audio_output_->processedUSecs() / 100000.0);
+ // Detach from parent (RtpAudioStream) to prevent deleteLater from being
+ // run during destruction of this class.
+ audio_output_->setParent(0);
audio_output_->disconnect();
audio_output_->deleteLater();
audio_output_ = NULL;