Skip to content

Commit

Permalink
GUI2/Network Transmission: rethrow any exceptions from the poller in …
Browse files Browse the repository at this point in the history
…the main thread

This is the same method used by the loading screen. Basically, connection::poll could throw and that exception
wasn't caught in the worker. Instead, it got stored in the std::future object, but was never accessed and therefor
never propagated.
  • Loading branch information
Vultraz committed Dec 4, 2020
1 parent ba1dbe5 commit ab770d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/dialogs/network_transmission.cpp
Expand Up @@ -68,6 +68,12 @@ void network_transmission::pump_monitor::process(events::pump_info&)

// Check if the thread is complete. If it is, loading is done.
if(poller_.wait_for(0ms) == std::future_status::ready) {
// The worker returns void, so this is only to handle any exceptions thrown from the worker.
// worker_result_.valid() will return false after.
if(poller_.valid()) {
poller_.get();
}

window_.get().set_retval(retval::OK);
return;
}
Expand Down

0 comments on commit ab770d1

Please sign in to comment.