mirrors: Run speed tests as GTask async operations #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quickly opening and closing the mirror selection dialog repeatedly has a chance of causing a segfault. In addition, the following Gtk critical error message is printed multiple times for every mirror that has not yet been tested at the time that the dialog is closed.
Gtk-CRITICAL **: gtk_list_store_get_value: assertion 'iter_is_valid (iter, list_store)' failed.
This occurs because the mirrors model gets cleared without waiting for the speed test thread to finish thus invalidating the remaining iterators.
The speed tests are now run using Gio Task async operations. They are launched in new threads and when complete, the callback which is invoked from the main thread checks if the task has been cancelled and if so it does not modify the model or access the now invalid iterators.