Wireshark-commits: [Wireshark-commits] master 0fef9d7: Fix crash in RTP Player on stop and close
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=0fef9d752f801986a81b7c294143eae21cd0de97
Submitter: Gerald Combs (gerald@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
0fef9d7 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>
Actions performed:
from e3eb9f3 CMake: Add Qt5Svg to PACKAGELIST.
adds 0fef9d7 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(-)