mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
Fix SEGV on cancel long search
A timing issue - when cancelling the background scan it is possible for the next scan to be performed after the controller has been deleted. This is an edge condition and pretty rare, but since it causes a crash pretty high impact.
This commit is contained in:
@@ -215,7 +215,9 @@ DeviceScanner::quickScan(bool deep) // scan quickly or if true scan forever, as
|
||||
// automatically discover a serial port ...
|
||||
QString error;
|
||||
foreach (CommPortPtr port, Serial::myListCommPorts(error)) {
|
||||
if (wizard->controller->discover(port->name()) == true) {
|
||||
|
||||
// check if controller still exists. gets deleted when scan cancelled
|
||||
if (wizard->controller && wizard->controller->discover(port->name()) == true) {
|
||||
isfound = true;
|
||||
wizard->portSpec = port->name();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user