Wireshark-commits: [Wireshark-commits] master-2.0 d92a5fa: Fix crash in RTP Player on stop and clos
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 17 Nov 2015 22:50:05 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=d92a5fa7b3404723cc23b9a83988c5e5bdd5456b
Submitter: Gerald Combs (gerald@xxxxxxxxxxxxx)
Changed: branch: master-2.0
Repository: wireshark

Commits:

d92a5fa by Peter Wu (peter@xxxxxxxxxxxxx):

    Fix crash in RTP Player on stop and close
    
    When dragging the UI, this somehow causes a great lag. Then by
    spam-clicking on the Stop button, a double free seems to occur.
    
    Fix this by moving the audio cleanup to the outputStateChanged callback
    as documented at https://doc.qt.io/qt-5/qaudiooutput.html. Note that
    calling stop() in the IdleState also triggers a change event, resulting
    in the desired cleanup.
    
    Stop streams before the dialog is closed (via accept/reject). This
    *cannot* be done in the destrutor of RtpPlayerDialog because destructing
    QAudioOutput processes events from the event queue, resulting in
    preature destruction of other objects... crash.
    
    Change-Id: I6bfb33c9396e9bc1ffd346519d22390a97b6bdaf
    Reviewed-on: https://code.wireshark.org/review/11894
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Gerald Combs <gerald@xxxxxxxxxxxxx>
    (cherry picked from commit 0fef9d752f801986a81b7c294143eae21cd0de97)
    Reviewed-on: https://code.wireshark.org/review/11930
    

Actions performed:

    from  804ee98   CMake: Add Qt5Svg to PACKAGELIST.
    adds  d92a5fa   Fix crash in RTP Player on stop and close


Summary of changes:
 ui/qt/rtp_audio_stream.cpp  |   16 ++++++++--------
 ui/qt/rtp_player_dialog.cpp |   17 +++++++++++++++++
 ui/qt/rtp_player_dialog.h   |    3 +++
 3 files changed, 28 insertions(+), 8 deletions(-)