Skip to content

Commit

Permalink
Fix a crash when the metaserver is down
Browse files Browse the repository at this point in the history
Closes #636.
  • Loading branch information
lmoureaux committed Sep 12, 2021
1 parent d03f413 commit 9990fa8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions client/gui-qt/page_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,21 @@ void page_network::update_network_lists()

lan_scan_timer = new QTimer(this);
lan_scan = server_scan_begin(SERVER_SCAN_LOCAL, server_scan_error);
connect(lan_scan_timer, &QTimer::timeout, this,
&page_network::slot_lan_scan);
lan_scan_timer->start(500);
if (lan_scan_timer) {
// The timer may have been destroyed if there was an error
connect(lan_scan_timer, &QTimer::timeout, this,
&page_network::slot_lan_scan);
lan_scan_timer->start(500);
}

meta_scan_timer = new QTimer(this);
meta_scan = server_scan_begin(SERVER_SCAN_GLOBAL, server_scan_error);
connect(meta_scan_timer, &QTimer::timeout, this,
&page_network::slot_meta_scan);
meta_scan_timer->start(800);
if (meta_scan_timer) {
// The timer may have been destroyed if there was an error
connect(meta_scan_timer, &QTimer::timeout, this,
&page_network::slot_meta_scan);
meta_scan_timer->start(800);
}
}

/**
Expand Down

0 comments on commit 9990fa8

Please sign in to comment.