Wireshark-commits: [Wireshark-commits] master-2.2 5d1fcac: Qt: fix crash when closing RTP player wh
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 30 Nov 2016 19:54:15 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=5d1fcac9e6c9c6a75c59b46d2bcca16f19c51550
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

5d1fcac by Peter Wu (peter@xxxxxxxxxxxxx):

    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@xxxxxxxxxxxxx>
    Reviewed-by: Gerald Combs <gerald@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    (cherry picked from commit 9887cd7feb7c377a3d046b924fe86907479be413)
    Reviewed-on: https://code.wireshark.org/review/18994
    

Actions performed:

    from  48a7576   Qt: Fix simple_dialog formatting.
    adds  5d1fcac   Qt: fix crash when closing RTP player while playing


Summary of changes:
 ui/qt/rtp_audio_stream.cpp |    3 +++
 1 file changed, 3 insertions(+)