diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2018-05-03 21:44:21 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2018-05-03 19:45:40 +0000 |
commit | 895cfbfd01672af06dd71556b12899dbc2c7e8cd (patch) | |
tree | 307d0c90a6db5c4c66faeb9037fe7a50e2019884 /ui/qt | |
parent | 751e9463ce5588631514573354c704171792c7db (diff) |
Qt: Add check for running toolbar reader thread
Check if the reader thread is running before calling requestInterruption()
in an attempt to avoid a crash when stop capture.
Change-Id: I07cdc19eb42413ce421f05186314fc34c33041e6
Ping-Bug: 14631
Reviewed-on: https://code.wireshark.org/review/27316
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/interface_toolbar.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/qt/interface_toolbar.cpp b/ui/qt/interface_toolbar.cpp index 6db94c25d4..140cbc639e 100644 --- a/ui/qt/interface_toolbar.cpp +++ b/ui/qt/interface_toolbar.cpp @@ -771,7 +771,10 @@ void InterfaceToolbar::stopCapture() { if (interface_[ifname].reader_thread) { - interface_[ifname].reader_thread->requestInterruption(); + if (!interface_[ifname].reader_thread->isFinished()) + { + interface_[ifname].reader_thread->requestInterruption(); + } interface_[ifname].reader_thread = NULL; } |