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>
This commit is contained in:
Stig Bjørlykke 2018-05-03 21:44:21 +02:00
parent 751e9463ce
commit 895cfbfd01
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}